Wednesday, February 27, 2008 (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.

Posted in code, interweb, tech

1 comment:

  1. dude #

    in before huphturs flash joke

Leave a Comment:

HTML allowed: <a href=""> <strong> <em> <code>

Powered by WordPress using the Minimal, Really Theme. Inspired by Things