SWFObject, External Interface, Internet Explorer

Just a tip. If you’re ever using SWFObject to write out your flash files and ExternalInterface to communicate with them, in Internet Explorer (6 & 7), make sure that the ID of your embedded flash file is all lowercase.

Take this basic code for example, used to mute the audio in a flash file from within HTML:

function audioOff() {
var so = new SWFObject("movie.swf", "foobar", "10", "10", "8", "#ffffff");

Let’s pretend for a minute that the ID of your flash file (foobar) was mixed case:

function audioOff() {
var so = new SWFObject("movie.swf", "fooBar", "10", "10", "8", "#ffffff");

When your ID is mixed case it fails in Internet Explorer.

Note: Using hyphens in your ID’s (foo-bar) will also fail. The hyphen fail is well documented on the web, so I certainly should have paid more attention to the use of mixed case. It’s always the simple things that take 3 days to figure out.