Alex Rivera | Logout

Detecting end of Flash movie in javascript

Asked 2009-11-18T10:51:03.903
9

Is there a way to detect end of Flash movie (OOTB, without using some sort of flash callback).

Alternatively, is there a way to know the length of the movie?

Update:

IsPlaying() looked promising (periodically checking it), but as it turns out, nobody is creating straight forward swfs any more; now, the content is embedded in main layer and while the content plays, the main movie is stopped and IsPlaying is always false...

Edit
Report

1 Answer

1
import fl.video.VideoEvent.COMPLETE
video.addEventListener(VideoEvent.COMPLETE, alertHTML);

function alertHTML(e:VideoEvent):void{
    ExternalInterface.call("alert(\"Video has stopped\");");
}

Give that a shot. You can replace the alert(\"Video has stopped\"); with your client-side javascript function.

answered 2009-11-18T19:40:01.223

Your Answer