Site Navigation

Friday, July 10, 2009

bug 167 - Flash ActionScript communication with IE fails

Issue: #167
Affects: IE6, IE7, IE8

Adobe's Flash /(SWF) uses ActionScript to interact with the browser and your HTML page. In particular you can call a JavaScript function on your page by using the ExternalInterface Object, using the .call(methodName) method.

However although the code is simple to invoke, you may drive yourself bonkers trying to figure out why it sometimes fails in IE.

Example:

//required imports
import flash.external.ExternalInterface;
//...your code...
ExternalInterface.call('yourPagesJSFunction');//Fails in IE (sometimes)


So how can this simple code work in Firefox and Safari yet fail in IE?


Known Workarounds: One.

The trick is in the unknown requirement... in IE, your <object> tag REQUIRES an ID attribute! The value doesn't matter, but it must be unique (all your IDs are unique aren't they?)


Example Workaround Code:

<object id="anyvalue">



Related Issues: None.

Bug/Site Feedback |
Submit a bug