开发者

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜