0

Good morning and thanks for taking a look. This is AS2, not AS3.

I've used this presentation setup for a couple of years now and I've yet to figure out how to make it jump from the video back to the 1st frame again. I usually just render out an extra few minutes of video that match the first frame, but that's getting annoying. Anyway, here is my setup: First frame has a stop command and the picture. The picture has a simple on(release){ gotoandplay(2);} This works perfectly. First frame setup and code Second frame looks like this: Second frame has the net connection stuff The video is left in the folder since it's about 200mb and linked in via the netconnection.

I would like for the presentation to jump back to frame 1 where the nice title slide is sitting once the video completes playing. I've tried several methods before, but my basic level of this stuff isn't helping me. Is there a listener I can add to this that will detect the end and allow me to gotoAndPlay(1)? Or I can even duplicate it to frame 3..

Thanks!

user
  • 113
  • 1
  • 9

1 Answers1

0

add this code in

ns.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);

private function netStatusHandler(evt:NetStatusEvent):void {
    if (evt.info.code == "NetStream.Play.Stop") {
        gotoAndPlay(1)
    }
}

[EDIT]

// do this instead of the code above
function myCallBack(o:Object):void{
  if (o.code == "NetStream.Play.Complete"){
    gotoAndPlay(1)
  }
}
ns.client = {onPlayStatus: myCallBack}
The_asMan
  • 6,364
  • 4
  • 23
  • 34
  • Thanks for the reply. I added the code below the ns.play and now when I click on the initial photo to jump to frame 2, it jumps right back to frame 1 without playing the video. Did I need to change any of my previous code as well? – user Oct 29 '12 at 14:02
  • Thank you. I ran out of time and had to set the render to go the old way. I will test this out afterwards and let you know. – user Oct 29 '12 at 16:06
  • Same thing is happening, I click the mc to go to the video frame and it just jumps back immediately. Since I've already had to move on, I'm going to go ahead and offer my final thanks for the assistance. I have 10 months until the next presentation and I think I'm going to rebuild it in AS3 and try to have something more solid. Thanks again! – user Oct 30 '12 at 12:33