How to capture an event trigger when a flash movie successfully loaded?

前端 未结 4 2085
梦谈多话
梦谈多话 2021-01-16 11:30

I\'m currently using jQuery, as well as swfObject to dynamically embed the swf movie into my web page.

I currently having a problem on embeding immem\'s music player

4条回答
  •  -上瘾入骨i
    2021-01-16 12:20

    Problem with the above-mentioned solution of using window.load() is it is not useful if your main swf weights only 1 kb but it actually doesn't display anything (just being a container that gets additional content loaded, which is often the case in flash files.

    What i would do is use Actionscript 's ExternalInterface class that allows your flash player to communicate with the javascript functions available in the html file which contains the flash file. You could have your flash file call a javascript function that triggers a function that tells your javascript processing script that the flash is ready. What is nice with this is that you get the exact level of control you need over what should be loaded in the flash file when the javascript takes over.

    See this for more info on the use of ExternalInterface: http://blog.circlecube.com/2008/02/01/actionscript-javascript-communication/

提交回复
热议问题