The Proper Way to Embed Flash Files (SWF)

Notice the annoying tooltip?

As you may have noticed, when you roll over a Flash animation embedded in a website while using Internet Explorer, you may see a tooltip that says “click to activate and use this control” and a dotted line around the object. This is the result of a recent legal battle that Microsoft lost to EOLAS , a patent holder, about the way Internet Explorer displays OBJECT tags in webpages. As a result of the lawsuit, Microsoft distributed an update for Internet Explorer requiring user input to display and activate ActiveX based media. The affects all ActiveX content, including Quicktime, JAVA, Acrobat, and just about any media/video player. This is a hassle when trying to integrate multimedia content into your webpages.

There are several types of fixes however. The simplest involves placing a javascript into your code that tells the browser how to display the object. (see http://www.halnesbitt.com/object-fix.html) The Flash movie (or other content) is still placed in the HTML using the EMBED, OBJECT, and PARAM tags, and it seems to work fine. But sometimes it will make the browser hang, and appear to still be loading one item, despite all content already haven been loaded.

A much better method is Bobby van der Sluis’s “Unobtrusive Flash Object (UFO)” method. This uses a javascript to tell the browser what to do with the Flash file, and uses DIVs to embed the content rather than the normal tags. It is very effective and easily implemented. To learn more, as well as download the necessary scripts, visit http://www.bobbyvandersluis.com/ufo/.

Published by

Hal

Aside from being a champion yo-yoer, I am the full-time computer geek at the American Society of Nephrology. I recently completed my MBA from George Washington University which I am hoping will enable me to finally afford my own bad habits. I also do freelance design, specializing in Flash, PHP, and ASP/ASP.NET.

Leave a Reply

Your email address will not be published. Required fields are marked *