开发者

How to call JavaScript method on load from Flash

开发者 https://www.devze.com 2023-03-15 00:10 出处:网络
I\'d like to know how I can trigger isLoaded() as soo开发者_开发问答n as my .swf movie is loaded.

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()
    }
}
0

精彩评论

暂无评论...
验证码 换一张
取 消