swfObject causing "Object doesn't support" error in __flash__addCallback function

4.1k views Asked by At

So, I have been stuck on this problem for some time now and it has caused a lot of frustration. I have found a lot of people over the many forum pages I have scoured who share the same problem but no one who has gave a clear answer as to why is this error being thrown and how to fix it.

I am using swfObject 2.2 to embed a background video onto a page I am working on and IE7/IE8 is throwing the error: "Object doesn't support this property or method" due to line 48 character 3. Upon opening up the developer tools to see what code is causing this error, I found this:

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

I tried finding where I was going wrong in my code and commented out everything besides:

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

This is the element swfobject is looking for:

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

To go a step further, I used an entirely empty .swf file to make sure the error was not being thrown by the .swf file itself.

I would really like to know if anyone has had experience with this error using swfobject and if there is something I can do to solve it.

2

There are 2 answers

6
lulalala On

I was having the same problem, and I found this blog entry:

Adobe Flash ExternalInterface issues with Internet Explorer

To summarize this maybe related to the play() and stop() function being reserved words. Even though you mentioned you are not using ExternalInterface calls, but have you tried renaming these methods yet?

0
Joe Parry On

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.