Link to home
Start Free TrialLog in
Avatar of Mr_Splash
Mr_Splash

asked on

FLVPlayback - Load new flv when flv finishes

I have a swf movie with an FLVPlayback component, which at startup has an flv loaded into it.

Can anyone tell me the actionscript that will load and play another movie when the first one finishes?
Avatar of julianopolito
julianopolito
Flag of Brazil image

name your flvplayback component as "flvp" (no quotes)

then in first frame

var listenerObject:Object = new Object();
listenerObject.complete = function(eventObject:Object):Void {
    flvp.load("other.flv");
    trace("loading other flv");
};
//Register a listener object so it is executed when movie finishes playing
flvp.addEventListener("complete", listenerObject);
Avatar of Mr_Splash
Mr_Splash

ASKER

Thanks juilianopolito,

I can't seem to get it to work. I've put the as below exactly as it is in my movie. (the initial movie is defined in the parameters) Any idea where I'm going wrong?

Also is it possible to loop the second movie?


var listenerObject:Object = new Object();
listenerObject.complete = function(eventObject:Object):Void {
    cb_player.load("/assets/videos/home-video-loop.flv");
    trace("loading other flv");
};
 
cb_player.addEventListener("complete", listenerObject);

Open in new window

try this
var listenerObject:Object = new Object();
var thisObj = this;
listenerObject.complete = function(eventObject:Object):Void {
    thisObj.cb_player.load("/assets/videos/home-video-loop.flv");
    trace("loading other flv");
};
 
cb_player.addEventListener("complete", listenerObject);

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of julianopolito
julianopolito
Flag of Brazil image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial