214-564-5316
Friday, May 09, 2008

"Click to activate and use this control"

April 06, 2006

Perhaps in browsing the web lately you have encountered a new behavior when using your Internet Explorer browser. As you move over Flash, Java Applets or other "objects" you are greeted with a small visual cue stating "Click to activate and use this control" and you will notice an outline surrounding the object.

If it is an active control (like a Flash menu, for instance) you must click the control to "approve" it before the Flash navigation buttons will work.

Microsoft this week delivered a long-awaited update for Internet Explorer 6 that changes the way the browser loads embedded ActiveX controls.

The modification comes as part of an ongoing patent dispute with Eolas Technology and the University of California.

In August 2003, a federal court ruled that Microsoft had infringed on a patent related to plug-in technology used in Internet Explorer.

Eolas was awarded $521 million in damages, which has ballooned to $560 million due to interest.

In response, Microsoft said it would alter how the browser implemented ActiveX, but later backed away from the switch. Software affected by the patent would include Macromedia Flash, QuickTime, RealOne Player, Acrobat Reader, Sun's Java Virtual Machine, and Windows Media Player among other applications that embed into Web pages.

But following two legal setbacks in its efforts to invalidate the Eolas patent and have the ruling appealed, Microsoft said in December it would go ahead with the update.

With the update, ActiveX controls will no longer be activated by default. The change in IE forces users to first click on the control before it will recognize any input.

As you might imagine this would be a nightmare for the users, forcing them to approve content like Flash or java applets prior to having them interact properly in the browser window.

The update -- available for Windows XP and Windows 2003 -- is currently available as an optional download from the Microsoft Download Center and Windows Update. Microsoft said it expects the majority of IE users to download the patch as part of their security updates over the next four to six months.

It's not clear if and when the company will issue an update for Windows 2000 users. Internet Explorer 7 for Windows XP and Windows Vista will include the change as well.

Here is a link to the Microsoft Page: http://msdn.microsoft.com/ieupdate/

The workaround is fairly straightforward:

First, download the javascript "flash-fix.js" (in a .zip format)

Then insert the script on every page that has an ActiveX control with this code:
<script type="text/javascript" src="flash-fix.js"></script>

Now find the code that embeds the Flash movie. Don’t delete it yet, because you’ll want to grab some of its parameters:

<object classid=" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="500" height="100" id="mymovie">
<param name="movie" value="movie.swf?variable=varvalue">
<param name="flashvars" value="variable=varvalue"> << Your code may not have variables.
<param name="loop" value="false">
<param name="bgcolor" value="#003399">
<embed ></embed>
</object>

Add this code after the last </object> tag.

<div id="flashcontent"></div>

You can keep the div’s ID ("flashcontent") or call it something else. Then, put your alternate content in between the <div id="flashcontent"> and </div> tags. This can be simple text, or it can be HTML code for a replacement image, whatever you want. This even allows search engines to index that alternate content as well.

Add this code underneath the <div id="flashcontent"></div> code:

<script type="text/javascript">
var fo = new FlashObject("movie.swf", "mymovie", "500", "100", "6", "#003399");
fo.addParam("loop", "false");
fo.write("flashcontent");
fo.addVariable("variable", "varvalue");
</script>

This short bit of Javascript is what passes in the Flash movie parameters from the original Flash code so that the javascript can display the Flash movie properly. Here’s the breakdown:

new FlashObject(
"movie.swf", << the file name of the Flash movie
"mymovie", << this matches the "ID" from your Flash movie parameters
"500", << the width of the Flash movie
"100", << the height of the Flash movie
"6", << the version of the Flash Player that is required
"#003399"); << the background color
fo.addParam("loop", "false"); << Add additional parameters here
fo.write("flashcontent"); << replace "flashcontent" with the name of the div ID, if you’ve changed it
fo.addVariable("variable", "varvalue"); << this is only necessary if you are passing in variables to the Flash movie through the HTML code. You can duplicate this line if you are passing in several variables.

Here is a list of possible parameters for flash: http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=tn_12701

At this point, you can delete the original Flash code (the <object> </object> tags) and everything in between.

For multiple objects you can create multiple containers:

<div id="flashcontent1"></div>

<script type="text/javascript">
var fo = new FlashObject("movie1.swf", "mymovie1", "500", "100", "6", "#003399");
fo.write("flashcontent1");
</script>

------------

<div id="flashcontent2"></div>

<script type="text/javascript">
var fo = new FlashObject("movie2.swf", "mymovie2", "200", "50", "7", "#ffffff");
fo.write("flashcontent2");
</script>

Warranty Exclusion
By downloading the file you agree that this software is a non-commercially developed program that may contain "bugs" (as that term is used in the industry) and that it may not function as intended. The software is provided "as is". TexasWebDevelopers.com makes no, and hereby expressly disclaims all, warranties, express, implied, statutory, or otherwise with respect to the software, including noninfringement and the implied warranties of merchantability and fitness for a particular purpose.

Limitation of Liability

In no event will TexasWebDevelopers.com be liable for any damages, including loss of data, lost profits, cost of cover, or other special, incidental, consequential, direct or indirect damages arising from the software or the use thereof, however caused and on any theory of liability. This limitation will apply even if TexasWebDevelopers.com has been advised of the possibility of such damage. You acknowledge that this is a reasonable allocation of risk