ExternalInterface.addCallback – Object doesn’t support property or method

If your facing some EXTREMELY frustating JavaScript mesages in IE when trying to a utilise a call method from javascript into action script, maybe I can help. I’ve just spent 4 hours tearing my hair out about this problem and finally got it solved. It was so frustrating and all google searches were returning lots of unrelated information with alot of fixes but no ultimate solution (for my problem anyway).

So, to make sure that IE can use ExternalInterface:

  • To get a reference to the flash movie, it shouldn’t be inside a form. If it must, in the case of .NET or Qcodo, use the solutions found at http://www.adobe.com/go/kb400730 OR use the swfobject.getObjectById function to get a reference.
  • Update to the latest version of SWFObject (at time of writing this is 2.1) to place the flash in your page.
  • The flash file must be visible on the page

I’ve placed the last point in bold as nowhere on the web was this a documented fix. I assume Internet Explorer might think this is “security” feature. I was displaying a modal window on top of the flash, which hid the flash from view as the flash can appear ontop of the modal window if the wmode parameter isn’t set to transparent.

The modal window needed to interact with the flash file, but couldn’t in IE because it was hidden.

4 Comments

  1. Justin
    Posted November 1, 2009 at 8:40 am | Permalink

    Spent several hours trying to figure this out today – thought I’d add my new wisdom to your list:

    1. Beware ActiveX reserved words, which will obviously only break IE. My problem was that I was registering a callback named ‘play’ – sure enough, a reserved word.

    2. When debugging in IE7, be sure to clear the cache by going to tools>Delete Browsing History. Control F5 doesn’t clear the cache of old .swf files like in other browsers.

  2. Posted January 7, 2010 at 2:48 am | Permalink

    I had a similar issue:

    In Firefox Addcallback worked like a charm – in i got the message like state in the title “Object doesn’t support property or method”

    Searching the web i found many tips and solutions – neither one solved my problem.

    My page is set up with a neat little Ajax calls using JQuery.
    So there is the solution:

    Instead of filling your page with something like

    $('#content').html(ajaxResponse);

    use the old-fashioned way:

    document.getElementById('content').innerHTML = ajaxResponse;

    So the whole request / output goes like this

    $.ajax({
    type: "GET",
    url: "myflashplayerTemplate.html"
    success: function(ajaxResponse){
    document.getElementById('content').innerHTML = ajaxResponse;
    }
    });

    I hope to save someone else’s time with this one ;)

  3. Jonas
    Posted June 3, 2010 at 2:03 pm | Permalink

    Thank you guys, I spent several days with this problem. With me occurred the same with Justin, i was using a reserved word ( “play”).

    Thank you so much

  4. digibo
    Posted June 30, 2010 at 12:21 am | Permalink

    Bless you, Marcel! You saved both my time and my hair!:) Thanks a lot

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">