Fix “Click to activate and use this control”

Fix “Click to activate and use this control”

Internet Explorer 7 has the annoying problem not to activate a flash movie until you click it. Most webmasters don’t know how to get rid of the “Click to activate and use this control”-problem. There is however a simple workaround available. It uses a simple Javascript-function, to echo the embed code with Javascript.

The Javascript part

Make a file named iefix.js and add the following code into it:

function fix(theText){
document.write(theText);
}

That’s all. This will make a function which will echo the text.

The HTML part

First of all, include the Flash into your (X)HTML file, between the two <head> tags.

<head>
<!– your title, meta, etc. –>
<script src=”iefix.js”>/script>
</head>

Now we have to change the code to embed the flash file. If you have this code:

<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=”400″ height=”300″ id=”movie” align=”">
<param name=”movie” value=”http://www.tizag.com/pics/flash/button1easy.swf”>
<embed src=”http://www.tizag.com/pics/flash/button1easy.swf” quality=”high” width=”400″
height=”300″ name=”movie” align=”"
type=”application/x-shockwave-flash”
plug inspage=”http://www.macromedia.com/go/getflashplayer”>
</object>

Change it into this:

<script type=”text/javascript”>
fix(’<object’)
fix(’classid=”clsid:D27CDB6E-AE6D-11cf-96B8-444553540000″ ‘)
fix(’codebase=”http://download.macromedia.com’)
fix(’/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0″‘)
fix(’width=”400″ height=”300″ id=”movie” align=”">’)
fix(’<param name=”movie” value=”http://www.tizag.com/pics/flash/button1easy.swf”>’)
fix(’<embed src=”http://www.tizag.com/pics/flash/button1easy.swf” quality=”high” width=”400″‘)
fix(’height=”300″ name=”movie” align=”" ‘)
fix(’type=”application/x-shockwave-flash”‘)
fix(’plug inspage=”http://www.macromedia.com/go/getflashplayer”> ‘)
fix(’</object>’)
</script>

That’s it

Job’s done. I made example to show the result.
The first one is the normal code, the second should display properly in Internet Explorer.

Was this article useful for you? Please leave a comment and tell how this tutorial helped you.

This entry was posted on Sunday, January 6th, 2008 at 5:43 pm and is filed under Flash. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
Comments
  1. Farrhad Says :
    1

    great help

  2. Righteous_Trespasser Says :
    2

    Nice one … did you find this on Ozzu?

  3. admin Says :
    3

    @R_T
    I saw it before, but I also saw your post on Ozzu. ;)
    When I noticed that most people didn’t know about this workaround, I decided to write about it on my blog :)

Leave a Reply