Adobe Flash ExternalInterface issues with Internet Explorer


Hits: 4715  

I was working for HTML5 Audio.js Player… I really like calling ExternalInterface when using SWFObject on Windows XP IE 8. You can’t use an actionscript callback for a certain set of keywords (“play”, “stop”, “tags”, “item”, “length” etc.) will break in IE and cause a javascript error.

Object doesn’t support this property or method

public function audiojs():void {
Security.allowDomain(“*”);

this.playerInstance = root.loaderInfo.parameters.playerInstance+’.’;

ExternalInterface.addCallback(‘init’, init);
ExternalInterface.addCallback(‘load’, load);
ExternalInterface.addCallback(‘playPause’, playPause);
ExternalInterface.addCallback(‘pplay‘, play);
ExternalInterface.addCallback(‘ppause‘, pause);
ExternalInterface.addCallback(‘skipTo’, skipTo);
ExternalInterface.addCallback(‘setVolume’, setVolume);

ExternalInterface.call(this.playerInstance+’loadStarted’);
}

Audio.js
IE doesn’t allow a method named play() to be exposed through ExternalInterface, so lets go with pplay().
Use ppause() for consistency with pplay(), even though it isn’t really required.

Avoid common names like play & pause when using ExternalInterface Call. 😉