我正在使用 swfObject 在我的应用程序中嵌入 Flash 播放器。在尝试与嵌入式 Flash 对象通信时,我偶尔会在 FireFox 中看到错误(仅在 IE 或 Chrome 中没有)。错误显示“SetVariable 不是函数”。导致此错误的代码刚才执行得很好,现在显示此错误。如果我重新加载页面并重新运行,那么这种情况不会再次发生的可能性是不错的。
我在网上看到过有关 FF 无法与 SetVariable 很好地配合使用的报告,但没有什么可以解决的。显然 swfObject 应该隐藏所有这些,但事实并非如此。
这是我的代码的样子:
...
var flashvars=...
var params=...
var attributes = {};
attributes.id = "my_player";
if( swfobject.hasFlashPlayerVersion("9.0.0") )
{
swfobject.embedSWF("my_player_js.swf", "my_player_holder", "1", "1", "9.0.0", "", flashvars, params, attributes );
}
....
document.getElementById("my_player").SetVariable( "method:stop", "");
FF 上的最后一行有时会导致“SetVariable 不是函数”错误。
关于在哪里看的任何建议?