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:

  1. function audioOff() {
  2. thisMovie("foobar").audioOff();
  3. }
  4. 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:

  1. function audioOff() {
  2. thisMovie("fooBar").audioOff();
  3. }
  4. 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.

One Response to “SWFObject, External Interface, Internet Explorer”

  1. dude says:

    in before huphturs flash joke

Leave a Reply