PDA

View Full Version : [AS2] How to gotoAndPlay at the end of a FLVPlayback movie


emmanuel33
03-10-2009, 03:27 PM
Hi guys,

I have a quick question that should be easy enough to solve...

I have a FLVPlayback instance on my main timeline and when it is done playing its movie I would like to be able to gotoAndPlay to a specific frame in my main timeline. Is there an action I can add to that FLVPlayback instance?

I've tried tracing what _currentframe my FLVPlayback movie is at but it keeps on reporting frame number 1. Is there something wrong with my FLV movie?

Thanks in advance!

asf8
03-10-2009, 03:34 PM
You can use a listener to know when its done playing, maybe you can adapt the code in this post to suit your needs... also review the link i that post also from the help docs.

http://www.actionscript.org/forums/showpost.php3?p=840893&postcount=5

endergrl
03-10-2009, 05:32 PM
in the example below my instance name for my flvplayer is ambient_FLVPlybk, so you would need to change that part to whatever your instance name is.

var ambientLoop:Object = new Object();
ambientLoop.complete = function(eventObject:Object):Void {
//place you goToandPlay(someFrame) here
};
ambient_FLVPlybk.addEventListener("complete",ambientLoop);

emmanuel33
03-10-2009, 06:42 PM
Thanks for the replies. You guys definitely pointed me in the right direction.

Here is the code that I inserted on my FLVPlayback instance :

onClipEvent (enterFrame) {
var listenerObject:Object = new Object();
listenerObject.complete = function(eventObject:Object):Void {
stopAllSounds();
_root.gotoAndPlay(100);
};
this.addEventListener("complete",listenerObject);
}