How to call JavaScript method on load from Flash
I'd like to know how I can trigger isLoaded() as soo开发者_开发问答n as my .swf movie is loaded.
function isLoaded(){
alert("Loaded");
}
my movie.swf loaded via SWFObject
Take a look at this.
Also if you want it to be called once your SWF has been fully loaded, just do this:
addEventListener(Event.ENTER_FRAME, _handle);
function _handle(e:Event):void
{
if(root.loaderInfo.bytesLoaded >= root.loaderInfo.bytesTotal)
{
removeEventListener(Event.ENTER_FRAME, _handle);
// Do ExternalInterface.call()
}
}
精彩评论