Copy link to clipboard
Copied
Hello,
I have two problems: my looping video has a seam and when i'm going to the next frame i get an 1009 error, because flvplayback component doesn't stop playing upon exitframe. I fixed first problem using kglad's code (see below). Second problem should be solved by adding this function (if i would have usual loop): FLVPlayback(e.currentTarget).stop();. But in my case it doesn't work and i still get an error when i'm trying to go to the next frame.
import fl.video.*;
var index:int = 0;
my_FLVPlybk.addEventListener(fl.video.VideoEvent.COMPLETE, completeHandler);
my_FLVPlybk.source = "test.flv";
my_FLVPlybk.play();
readyNextPlayerF();
function completeHandler(e: fl.video.VideoEvent):void{
my_FLVPlybk.play();
my_FLVPlybk.visibleVideoPlayerIndex = index;
readyNextPlayerF();
}
function readyNextPlayerF():void{
index++;
my_FLVPlybk.activeVideoPlayerIndex = index;
my_FLVPlybk.source = "test.flv"; //assign the source
}
my_FLVPlybk.addEventListener(Event.REMOVED_FROM_STAGE, stopVideoF);
function stopVideoF(e:Event): void {
FLVPlayback(e.currentTarget).stop();
}
Copy link to clipboard
Copied
i don't see a problem with your code, but just for fun try:
my_FLVPlybk.addEventListener(Event.REMOVED_FROM_STAGE, stopVideoF);
function stopVideoF(e:Event): void {
my_FLVPlybk.removeEventListener(Event.REMOVED_FROM_STAGE, stopVideoF);
my_FLVPlybk.stop();
my_FLVPlybk=null;
}
Copy link to clipboard
Copied
I replaced:
my_FLVPlybk.removeEventListener(Event.REMOVED_FROM_STAGE, stopVideoF);
with
my_FLVPlybk.removeEventListener(fl.video.VideoEvent.COMPLETE, completeHandler);
and now it works fine, thank you.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now