Search code examples
javascriptflash

How to know when external swf is loaded?


I have Javascript that loads external swf, appending tags "object" and "embed" when page has been loaded. I need to handle event when swf is completely load.


Solution

  • You can use externalInterface.call() to get the flash to call a function in your js. This is assuming that you are publishing the flash yourself, or can at least get the creator to add a call for you.

    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/external/ExternalInterface.html

    Edit is not possible (Option #2): You could create your own swf file to act as a loader for the swf content. Your swf would be able to track progress and communicate with the JS.