2

所以,我一直在这个问题上停留了一段时间,这引起了很多挫败感。在我搜索过的许多论坛页面上,我发现很多人都有同样的问题,但没有人明确回答为什么会抛出这个错误以及如何解决它。

我正在使用 swfObject 2.2 将背景视频嵌入到我正在处理的页面上,而 IE7/IE8 抛出错误:“对象不支持此属性或方法”由于第 48 行字符 3。打开开发人员工具后要查看导致此错误的代码,我发现了这一点:

function __flash__addCallback (instance, name) {
   instance[name] = function () {
    return eval(instance.CallFunction("<invoke name=\""+name+"\" returntype=\"javascript\">" +          __flash__argumentsToXML(arguments,0) + "</invoke>"));
   }
} 

我试图找出我的代码哪里出了问题,并注释掉了除以下内容之外的所有内容:

swfobject.embedSWF('http://localhost/flash/player.swf', 'video_player', '100%', '100%', '9.0.0'); 

这是 swfobject 正在寻找的元素:

<div id="video_player"></div>

为了更进一步,我使用了一个完全空的 .swf 文件来确保 .swf 文件本身不会引发错误。

我真的很想知道是否有人使用 swfobject 遇到过这个错误,以及我是否可以做些什么来解决它。

4

2 回答 2

6

我遇到了同样的问题,我发现了这个博客条目:

Internet Explorer 的 Adob​​e Flash ExternalInterface 问题

总而言之,这可能与 play() 和 stop() 函数是保留字有关。即使您提到您没有使用 ExternalInterface 调用,但您是否尝试过重命名这些方法?

于 2011-08-29T08:11:48.303 回答
1

I'd like to add to the list of 'bad' words according to IE8.

We had to rename methods called 'zoom' and 'pan' which were causing the same issue. Other people have reported 'stop' as another bad word to use.

Luckily the fix is easier than finding the precise cause: just rename your methods.

于 2012-02-19T13:59:57.093 回答