Web Hosting

Now the #1 Directory for Website Designers on Google!

Internet Explorer Update Breaks Flash: Fixing Flash and other Objects to Work with IE 6 and IE 7

by Andrew Charles 05-10-2006
In case you needed another reason to switch to a standards-compliant Web browser, Internet Explorer just broke your Flash-based Website. With the release on May 2, 2006 of the Microsoft update titled "Internet Explorer ActiveX Update", most embedded Flash Web content will cease to allow user interaction until it has been "activated."

What this really means is your Flash content and Flash Websites will not receive mouse or keyboard events until it has been clicked on at least once by the user! Apparently, Microsoft did this to bolster its case in a patent lawsuit with Eolas Technologies Inc.
What Versions of Internet Explorer and Windows are affected?

Microsoft Internet Explorer 6.0, when used with:
Microsoft Windows Server 2003, Standard x64 Edition
Microsoft Windows Server 2003, Datacenter x64 Edition
Microsoft Windows Server 2003, Enterprise x64 Edition
Microsoft Windows Server 2003 Service Pack 1
Microsoft Windows XP Professional x64 Edition
Microsoft Windows XP Service Pack 2

Microsoft Internet Explorer 7 (beta as of this writing)
So what can you do as a Website designer, Web devloper or Flash designer to deal with this potentially crippling change in such a widely used browser? Just accept that your formerly interactive Website isn't so, er, "interactive" any longer? Of course not - instead, use the technique outlined below and save Flash from yet another Microsoft-related mess.

When working around the Flash issues caused by this new IE update, it's important to note what it affects. Internet Explorer will no longer allow interaction with objects that were included from the original HTML page via an APPLET, EMBED or OBJECT tag.

What it doesn't affect are objects that are included via an external javascript. Emphasis here should be placed on the word EXTERNAL. Inline javascript will not work here.

There are a couple of ways to do this. Many people are turning to open source javascript libraries such as SWFObject (formerly FlashObject). But if you're like me, you shy away from large javascript files that you didn't write (your Website is full of enough large javascript files you wrote all by yourself).

Here's what my old HTML code looked like that IE no longer respects:
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="100" height="100" id="movie" >
<param name="movie" value="mymovie.swf" />
<param name="wrmode" value="transparent" />
<param name="menu" value="false" />
<!--[if !IE]> <-->
<object type="application/x-shockwave-flash" data="mymovie.swf" width="100" height="100">
</object><!-->
<![endif]-->
</object>
This code worked great. It worked across browsers, and it was standards compliant. In order to keep using it, I made a new javascript file, flash.js, with the following code:
function flash_write(file, width, height) {
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+width+'" height="'+height+'" id="movie" ><param name="movie" value="'+file+'" /><param name="wrmode" value="transparent" /><param name="menu" value="false" /><!--[if !IE]> <--> <object type="application/x-shockwave-flash" data="'+file+'" width="'+width+'" height="'+height+'"></object><!--> <![endif]--></object>');
}
I then included this file in my page via a regular script tag:
<script type="text/javascript" src="flash.js"></script>
Now, when I need to place a Flash object in my html page, I just access the function where I need it:
<script type="text/javascript">flash_write('mymovie.swf', 100, 100);</script>
It's that simple! And, yes, it is ridiculous to need to do this. But we're all used to working around the limitations of the browsers our users "choose" to use. Better yet, this is another useful hack to add to the old coder's toolbox.

Related Resources Links:
The Microsoft Update: http://support.microsoft.com/kb/912945
Eolas Technologies Trial Info: http://www.eweek.com/article2/0,1895,1895907,00.asp