我需要知道我的 swf 何时准备好开始播放(例如初始加载程序已完成下载)。我知道我可以在 swf 内的 [loader][1]
处理程序中使用 ExternalInterface.call('someJSFunc')
,但如果可能的话,我宁愿不使用那种依赖。
在 JS 中有更好的方法吗?到目前为止我唯一想到的是:
// continually check if the flash is ready
var int = setInterval(function(){
var fl = $('#flashMovie').get(0);
if (fl) {
doThings();
clearInterval(int);
}
}, 50);
最佳答案
swfobject.embedSWF(swfUrl, id, width, height, version, expressInstallSwfurl, flashvars, params, attributes, callbackFn)
不确定这是否对您有帮助,但 swfobject 的最后一个参数是创建 swf 标记时调用的回调函数。
callbackFn (JavaScript function, optional) can be used to define a callback function that is called on both success or failure of creating a Flash plug-in <object> on the page (see API documentation)
更多信息here :
关于javascript - 如何判断 swf 何时完成从 javascript 的加载?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14263661/