April 30, 2006
Flash Embedding and Detection
Earlier this month, Microsoft announced a security update to Internet Explorer that changes the way it handles web pages that contain ActiveX controls. This would affect any control (Flash, video plug-in, etc.) that uses the APPLET, EMBED, or OBJECT tags. Basically the control's user interface is blocked until the user activates it by clicking on it or hitting the space bar when it has focus.
SWFObject 2.0 was recently just released.
Another useful JavaScript library for Flash is SWFAddress which sits on top of SWFObject that allows Flash movies to use the browser back button by creating unique URLs with page titles that you specify in your ActionScript code.
A new JavaScript library called FlashReplace has recently come on the scene to embed Flash written by Robert Nyman.
Adobe updated their Active Content Article using a code script contained in AC_RunActiveContent.js for embedding Flash and Shockwave in IE. Here is the code sample (.zip) that is included. This script is also included in the Dreamweaver 8.0.2 update and in Dreamweaver CS3. So via the Insert menu to embed Flash media the code is automatically generated.
Workarounds are available from both Microsoft and Adobe which use JavaScript to dynamically write these tags to embed the control. These work to a certain degree, but the most complete solution by far is a JavaScript library created by Geoff Stearns called SWFObject which detects and embeds Flash content on a web page.
Done separately, you would detect for the version of Flash player using Adobe's Flash Player Detection Kit and then use the embedding workaround provided by either company.
Also, you can checkout an alternative JavaScript library by Bobby van der Sluis called UFO. He also wrote on A List Apart a very detailed article on the issues of flash embedding. Great stuff.
