A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: Help With Video Ending

  1. #1
    Member
    Join Date
    Aug 2003
    Location
    Texas
    Posts
    82

    Help With Video Ending

    Please go to http://www.troubleshooterpc.com
    How do I add "play again" button and picture images after the video finishes playing?
    I don't want to leave it blank/black once the video finishes, it looks ugly.
    Please help!!!!
    Thank you in advance.
    Ghost

  2. #2
    Member
    Join Date
    Aug 2003
    Location
    Texas
    Posts
    82
    can somebody help me out here please? I want to be able to do what youtube video does after it ends.

    Is there a way i can make the player jump to another frame in a layer once the video ends?
    Last edited by ttfb05; 10-30-2007 at 11:57 AM.
    Ghost

  3. #3
    Senior Member layerburn's Avatar
    Join Date
    Jul 2006
    Location
    USA
    Posts
    542
    You can add a listener to the video so that when the video is done playing the project goes to a different frame where you can have a still. Really easy to do, just add this code to the same frame that your video is on and change the frame you want to go to in the code, also update the instance name of your video object in the code to match what you named yours.

    Code:
    stop();
    
    var listener:Object = new Object();
    listener.complete = function() {
         _root.gotoAndPlay(2);
         //frame you want to go to when the video has finished playing
    };
    
    my_video.addEventListener("complete",listener);
    //my_video is the instance name of the video object
    hope this helps.
    This is your brain. This is your brain on script.

  4. #4
    Member
    Join Date
    Aug 2003
    Location
    Texas
    Posts
    82
    Hi, thank you for your response and help. So if I changed the instance name to "video" where do i put the word "video" in the code?
    Thank you.
    Last edited by ttfb05; 10-30-2007 at 02:23 PM.
    Ghost

  5. #5
    Member
    Join Date
    Aug 2003
    Location
    Texas
    Posts
    82
    I think I got it. I just replaced the second "listener" with "video" and it seems to be working.
    thank you.

    stop();

    var listener:Object = new Object();
    video.complete = function() {
    _root.gotoAndPlay(2);
    //frame you want to go to when the video has finished playing
    };
    Last edited by ttfb05; 10-30-2007 at 02:35 PM.
    Ghost

  6. #6
    Senior Member layerburn's Avatar
    Join Date
    Jul 2006
    Location
    USA
    Posts
    542
    Where is says "my_video", make it just "video" if that is what your instance name is.
    This is your brain. This is your brain on script.

  7. #7
    Member
    Join Date
    Aug 2003
    Location
    Texas
    Posts
    82
    Great, I tried that and it worked too. Thank you so much for your help!
    Ghost

  8. #8
    Member
    Join Date
    Aug 2003
    Location
    Texas
    Posts
    82
    I am having an issue with this. When I tested on a simple Scene 1, everything worked the way it should. But when I try to add the video in Scene 1/symbol 1/symbol 2/symbol3, the video does not work. Is there a different code to reconize the symbols?
    Thank you
    Last edited by ttfb05; 10-31-2007 at 05:07 PM.
    Ghost

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center