Skip navigation
Currently Being Moderated

Move on to the next scene after FLV ends

May 3, 2012 11:59 PM

Before you say anything, I have searched every single thread on the internet and still can't get it to work.  I'm sure this is an easy fix for someone who knows Flash very well.  So in my project I have this FLV video embeded and I want it to move to the next scene/frame when it ends.  I'm using AS3 btw.  This is what my code looks like at the moment. So all I want is that when the FLV video ends, it automatically moves on to the next scene or frame.  Thanks in advance.

 

 

 

stop();

skipintro.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene);

 

function fl_ClickToGoToScene(event:MouseEvent):void

{

    MovieClip(this.root).gotoAndPlay(1, "Scene 2");

   

}

 

introvideo.addEventListener(Event.REMOVED_FROM_STAGE, stopPlay);

function stopPlay(e:Event)

{

      introvideo.stop();

    

}

 
Replies
  • Currently Being Moderated
    May 4, 2012 4:35 AM   in reply to Formation_2

    If you are using an FLVPlayback component then assign a listener for the COMPLETE event and have the event handler function deal with advancing down the timeline.

     
    |
    Mark as:
  • Currently Being Moderated
    May 4, 2012 10:53 AM   in reply to Formation_2

    Show the code you tried that didn't work and explain it.

     
    |
    Mark as:
  • Currently Being Moderated
    May 4, 2012 11:37 AM   in reply to Formation_2

    I saw that code but it is not assigning a COMPLETE event listener.  You said you already tried doing that before, so I guess you didn't understand what I said to do...

     

    import fl.video.VideoEvent;

     

    stop();

    skipintro.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene);

     

    function fl_ClickToGoToScene(event:MouseEvent=null):void

    {

        gotoAndPlay(1, "Scene 2");

     

    }

     

    introvideo.addEventListener(VideoEvent.COMPLETE, stopPlay);

    function stopPlay(e:Event)

    {

         introvideo.stop();

         fl_ClickToGoToScene();

    }

     
    |
    Mark as:
  • Currently Being Moderated
    May 4, 2012 1:14 PM   in reply to Formation_2

    You seem to have a reading comprehension issue of some sort... not intended as an insult, but you really oughta read thru this thread after you're done with it to see what I mean. 

     

    I said to use a COMPLETE listener.  You said you tried that before and it didn't work. So I asked you to show what you tried before that didn't work and you showed me what you already showed instead. 

     

    Now you are asking me to show you the code that needs changing...  I just did.

     
    |
    Mark as:
  • Currently Being Moderated
    May 4, 2012 2:40 PM   in reply to Formation_2

    you said:

    in my project I have this FLV video embeded

     

    this suggests to me that you imported your video into your flash file... so read this link:

    http://help.adobe.com/en_US/Flash/10.0_UsingFlash/WSBDABD69F-D146-4e5c -9340-BF717A10426C.html

     

    specifically:

     

    A best practice is to place video inside a movie clip instance, because you have the most control over the content. The video’s Timeline plays independently from the main Timeline. You do not have to extend your main Timeline by many frames to accommodate the video, which can make working with your FLA file difficult.

     

     

    so you may want to control the timeline of the movieclip your video is embedded in like this...

     

    videoMc.addEventListener(Event.ENTER_FRAME, goNext);

     

    function goNext(e:Event){

          if(videoMc.currentFrame == videoMc.totalFrames){

                //go to next scene or frame

           }

    }

     
    |
    Mark as:
  • Currently Being Moderated
    May 4, 2012 4:26 PM   in reply to Formation_2

    at the bar

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points