Need to execute some action when your FLV reaches the end? Pretty simple…
//you need to import the VideoEvent (no idea why??)
import fl.video.VideoEvent;
//Add an EventListener – replace ‘myvideo’ with your video instance name and ‘VideoEndAction’ with the function you want to run.
myvideo.addEventListener(VideoEvent.COMPLETE, VideoEndAction);
function VideoEndAction(evt:VideoEvent):void{
//some action here
}
Didn’t know about the import videoEvent thing. Couldn’t figure out why my end action wasn’t working. Then I found this post. Thanx a lot!!!
Well the line import fl.video.VideoEvent imports the VideoEvent class which handles the video related events READY, COMPLETE, CLOSE and so on.
If you don’t want to import VideoEvent class directly, you can always use just
import fl.video.* which imports all classes under fl.video. (FLVPlayback,SoundEvent etc)
Thanks so much. You saved me some big headaches.
My brother suggested I would possibly like this website. He was once entirely right. This publish truly made my day. You can not imagine just how so much time I had spent for this information! Thanks!