Issues with ExternalInterface.Call / Internet Explorer and swfObject

Category Icon

A lot of sites these days use swfobject. It’s probably one of, if not the the best flash embedders out there. Any site that needs flash, it’s the first library I go for. It’s pretty elegant in its solution:


var flashvars = {};
flashvars.name1 = "hello";
flashvars.name2 = "world";

var params = {};
params.menu = "false";

var attributes = {};
attributes.id = "myDynamicContent";
attributes.name = "myDynamicContent";

swfobject.embedSWF("myContent.swf""myContent""300""120""9.0.0",
"expressInstall.swf"flashvarsparamsattributes);

There is one problem though if you are trying to use the ExternalInterface.Call function with any IE browser. If you are trying to pass attributes and have an attributes tag, such as attributes.id = ‘flashContainer’ (like I did) the ExternalInterface.Call functionality will be totally lost. It will work with Firefox, Safari, Chrome, but not Internet explorer. To fix this issue, I had to change the function, removing the attributes tag all together, making the like this:


swfobject.embedSWF("myContent.swf""myContent""300""120""9.0.0",
"expressInstall.swf"flashvarsparams);

Luckily for this particular project I didn’t need the flash attributes all that bad. This handy tidbit brought to you by 16 hours of debugging.

 

Categories:
Previous entry: FLVPlayback Skin not working as intended
Next entry: Techsmith Encoder on a Mac

Comments

Leave a comment

Name:
Email:
Location:
URL:
Remember my personal information
Notify me of follow-up comments?

Submit the word you see below: