Warning: A non-numeric value encountered in /homepages/10/d677520614/htdocs/ryanragle.com/wp-content/themes/Divi/functions.php on line 5560

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", flashvars, params, attributes);

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", flashvars, params);

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.