Nuclear Rooster

23May/081

Getting ExternalInterface to work with IE7

Pretty much every blog post I have starts off with "The other day," or "Recently," so I decided to start this one off differently. Anyhoo, now that that is out of the way, we can get to the good stuff. So, recently, I was trying to determine the current page a SWF was loaded on using ActionScript's ExternalInterface class. There are a few oddities around working with ExternalInterface, including the flash runtime's security sandboxing and the pain of cross-browser embedding.

Everything works great, for instance, and then you export a release build and it doesn't work. Or trouble going from a file:// to http://. Anyway, after sufficient logging, I was well on my way. And then, boom, IE drops the the ball again.

Internet Explorer 7: Epic fail

IE, you epic fail

Anyway, after much Parallels-ing and googling, I get an answer. It wasn't giving the object tag an id

classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" .....

[HTML]
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"
WIDTH="550" HEIGHT="400" id="myMovieName"> NAME="myMovieName" ALIGN="" TYPE="application/x-shockwave-flash"
PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">

[/HTML]

Here are some helpful links

Flash OBJECT and EMBED tag syntax

Flash OBJECT and EMBED tag attributes