Fixing Explorer… again: Flash ‘Click to activate and use this control’ problem

8.08.2007 | Old Posts

Ever since Microsoft released an update of Internet Explorer 6, users have been getting the ‘Click to activate and use this control’ when rolling over Flash content. This is particularly frustrating when using Flash for navigation, as it means having to double click.

click2.jpg

I found out that the simplest fix for this is to use Javascript. So I wrote my own script to fix this problem.

flash.js

1
2
3
4
5
6
7
8
function flashFile(name, width, height)
{
document.write('<object type="application/x-shockwave-flash" data="'+name+'" width="'+width+'" height="'+height+'">\n');
document.write('<param name="movie" value="'+name+'">\n');
document.write('<param name="quality" value="high" />\n');
document.write('<param name="wmode" value="transparent" />\n');
document.write('</param></object>\n');
}

Very simple script. All you are doing here is writing the flash code with Javascript.

Now within your HTML import the javascript file between the HEAD tags:

<script type="text/JavaScript" language="javascript" src="flash.js"></script>

Then wherever you want to use flash in your HTML page put:

<script type="text/javascript">flashFile("movie.swf", "500", "144");</script>

Enjoy

  • Digg
  • StumbleUpon
  • del.icio.us
  • Reddit
  • Wikio
  • Technorati
  • Pownce
  • E-mail this story to a friend!

Similar Posts

Comments