Fixing the "base" attribute for Flash embedded in IE


By daniel - Posted on 10 May 2007

I discovered that one of my Flash apps wasn't working in Internet Explorer. The movie would appear but the external XML file wasn't being loaded. The movie is embedded using a Javascript Eolas fix and since the SWF is stored elsewhere on the server, I used the "embed" and "object" tags' "base" attribute to make sure external assets would still work. Unfortunately, IE wasn't reading the base attribute properly.

Checking the server error logs, I found that IE was looking for the XML file in the directory above the one I specified. The fix was fairly simple:

Old base attribute: "http://domain.tld/path/to/external/assets/"
New base attribute: "http://domain.tld/path/to/external/assets/."

The period at the end doesn't break the movie for Firefox because it's simply a reference to the current directory. IE reads the attribute properly and looks for the XML file at the correct URL. Woot!