external interface unspecified error - line 49 Char 5

Peter Vullings's picture
Peter Vullings
Wed, 18/11/2009 - 14:35

This one had me stumped for some time trying to get External Interface to work properly in Internet Explorer (IE) when it was working fine in Firefox.  While attempting communication between actionscript and javascript I would get a javascript error 'Unspecified error - line 49 char 5' which seemed to be in the function __flash__addCallback.
 
According to different blogs around the globe, it seems there can be several reasons why you will get this error.  One solution relates to cross-domain security, and others relate to the use of id and name tags in the HTML.
 
However, in my implementation I am accessing the script element dynamically and have a reference to it (so I don't need an id or name), and for some reason external interface will still work even if allowScriptAccess is set to false!
 
In the end the solution was very simple - if you are calling a javascript function with ExternalInterface.call and you are expecting a result passed back from javascript, if the javascript function you are calling generates an exception you will get the unspecified error message on line 49 char 5.
 
So next time I am scratching my head wondering how Adobe could have possibly let such a gross bug through QA I better double-check my own code first :)
 
...
 
p.s. I am not actually blaming Adobe. My last paragraph is in reference to an office joke - whenever we run into a particularly tough bug we joke 'Must be a bug in Flash' :)


Sheepish

Old MacDonalds sheep station is suffering from...

Rune Mage

Rune Mage is an addictive puzzle game...

While experimenting with beans in his secret...

Mr Ice Cream

Everyone's favourite Mr. Ice Cream is on his...

Try to squash that pesky frog for the high...