SWFObject ExternalInterface bug on IE

I experienced a problem calling ExternalInterface.call when using SWFObject on IE.
Actually, I figured out that it wasn’t any bug. Just a little miss.

On IE, the Flash looks for the Flash Object by the Object’s ID.
So, what you need to do is just set the right name and id of the flash object you are embedding

swfobject.embedSWF(“myflash.swf”, “flash_content”, “100%”, “100%”, “9.0.0″, “expressInstall.swf”, undefined, undefined, {id:“flashMovie”, name: “flashMovie”});

Just that!
I hope it helps someone that experienced the same problem.

8 Comments »

  1. Vaclav Vancura said,

    February 29, 2008 @ 7:03 pm

    You saved my day. Thanks! :]

  2. David Higgins said,

    April 4, 2008 @ 7:58 am

    I’m having an issue with SWFObject and ExternalInterface.addCallback … I was browsing around and noticed that Mihai Bazon (http://mihai.bazon.net/blog/flash-s-externalinterface-and-ie) ran into a similar issue … just curious, as you didn’t mention this problem … if you know of a work-around to it?

    In Firefox, my addCallback’s are registering just fine and my JS-code can execute my AS-code without issue … in IE, I get ‘object does not support this property or method’ errors — I’ve tracked it down to the __flash__addCallback(instance, name) method that appears to be dynamically injected into the browser by the flash plugin … problem is ‘instance’ has no ‘CallFunction’ method, and therefore can’t execute the “” XML ….

    Any suggestions?

  3. Og2t said,

    June 25, 2008 @ 6:29 pm

    Oh I so needed it over a year ago but couldn’t find a solution anywhere. Thanks a million!

  4. Micah said,

    August 6, 2008 @ 10:37 pm

    I’m having the same problem as David Higgins. It is getting very frustrating. Does anyone know how to solve this problem? Also, all the swfobject.js files I’ve tried using (including v1.5.1) give me the javascript error: “n has no properties” in firefox. Any help would be greatly appreciated.

  5. Ronny Karam said,

    September 9, 2008 @ 6:47 pm

    Hi,

    Actually I’m having the same problem as David & Micah. I got to flash__ addCallback method and I’m sure it’s causing the problem yet there’s not working solution for it. Not adding an id to the object is not a problem, the problem is when you’re using externalInterface and actually add the id to the object, IE goes crazy and displays the error message: Object doesn’t support property or method.

    Regards.

  6. Adam Fisk said,

    October 31, 2008 @ 2:48 pm

    Same IE problem here. Are you guys all add the callbacks in the constructor? I’ll be experimenting tomorrow with a separate method that adds the callbacks — more likely my object will be in the DOM at that point. Would try it now, but it’s a little on the late side.

    I’ll let you know if I find anything.

  7. Adam Fisk said,

    November 2, 2008 @ 10:23 am

    The problem for me did have to do with the ID. I’m not sure what SWFObject is doing under the covers, but the following did not work for me:

    var flashvars = {};
    var params = {};
    params.play = “true”;
    params.loop = “false”;
    params.quality = “high”;
    params.allowscriptaccess = “always”;
    var attributes = {};
    attributes.id = “LittleShoot”;
    attributes.name = “LittleShoot”;
    attributes.align = “middle”;
    swfobject.embedSWF(”LittleShoot.swf”, “littleShootNoFlash2″, “1″, “1″, “9.0.0″, “expressInstall.swf”, flashvars, params, attributes);

    whereas this did:

    var flashvars = {};
    var params = {};
    params.play = “true”;
    params.loop = “false”;
    params.quality = “high”;
    params.allowscriptaccess = “always”;
    var attributes = {};
    attributes.id = “littleShootFlashContent”;
    attributes.name = “LittleShoot”;
    attributes.align = “middle”;
    swfobject.embedSWF(”LittleShoot.swf”, “littleShootNoFlash2″, “1″, “1″, “9.0.0″, “expressInstall.swf”, flashvars, params, attributes);

    Notice the attributes.id value. It looks like there may have been an issue with the flash object having the same name as the object id, something like that. Good luck.

  8. Tim H said,

    November 8, 2008 @ 8:18 am

    I wrestled and cursed about this problem for a whole day.
    Here is the official adobe solution:

    http://kb.adobe.com/selfservice/viewContent.do?externalId=kb400730

    Check it out, they have 2 solutions, one didnt work for me, the other did work.

RSS feed for comments on this post · TrackBack URI

Leave a Comment