[Fixed] Click to Activate and Use This Control

Please note that this post was migrated to my new blog platform. There may be bad formating, broken links, images, downloads and so on. If you need an item on this page, please contact me and I will do my best to get it from my backups.

~E

Update 2006-08-25: In the comments below I mentioned a 2nd method that loops through all objects on the page and “re-injects” them.  This actually works very well and lets you use the <object> tags normally without worrying about the javascript below (if placed in the correct location in CS).  It works with Windows Media Player, Flash, and any other <object> tag.  Here’s the link:

http://www.mix-fx.com/flash-prompt.htm

The downside is it is only supported in newer browsers that support the document.getElementsByTagName - which most do these days.  But I like to code for old 4.0 and above browsers (my JS is all 4.0+, including Netscape 4.08).  I might modify his code to do this when I get back from vacation.

You can continue read the history of this issue below.

——————–

So with a recent Internal Explorer patch (automatic update), you might start noticing that you have to click a Flash, Quicktime, Realplayer, or WMV in order to “use” the control.  Annoying right?

The mouse-over presents the text, ”Click to activate and use this control”. 

This is due to a recent court battle that MS lost in the way IE deals with <object> and <embed> tags. 

The Fix
Recently I am working on my building’s website at www.2220cantonlofts.com.  Now the new page isn’t online yet, give me until the end of June to complete it.  And yes I know what is currently  there sucks ass.  That’s why I am overhauling it.  Anyhoot…  I’m using two flash movies and noticed this problem - and it ticking me off.

To fix this it took some playing with the HTML and object tags.  Basically I found that if you render the HTML after the page has rendered (i.e. InsertHtml), it does not require you to click to activate.

Appearently Macromedia found out about this and posted an “IE” fix.  But I believe it needs a little tweaking because most of use querystrings and have multiple flash versions on our site.

I’ll sum it up for you in full.

The fix is insert the <object/embed> text while the page is rendering/being interpreted by the browser.  So long as it doesn’t exist in the source/html file.  It must be rendered outside of the source file.

Instructions to install:

  1. Download the attachment to this blog post, place it somewhere on  your website.
  2. Insert this text into your <head> portion (it’s a check to ensure the file loaded, this prevents JS errors if the file doesn’t load)

    • <
      script type=”text/javascript” language=”javascript”>AC_FL_RunContent = 0;</script>
      <script type=”text/javascript” src=”AC_RunActiveContent.js” language=”javascript”></script>

  3. The last would be to replace your entire <object></object> text with the following script:

    • <script type=”text/javascript” language=”javascript”>
      if (AC_FL_RunContent == 0) {
        alert(“This page requires AC_RunActiveContent.js”);
      } else {
        AC_FL_RunContent(
          ‘codebase’,
          ‘https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0’
      ,
          ‘width’, ‘745’,
          ‘height’, ‘171’,
          ‘src’, ‘menu.swf’,
          ‘quality’, ‘high’,
          ‘pluginspage’,
          ‘https://www.macromedia.com/go/getflashplayer’
      ,
          ‘align’, ‘middle’,
          ‘play’, ‘true’,
          ‘loop’, ‘false’,
          ‘scale’, ‘noscale’,
          ‘wmode’, ‘window’,
          ‘devicefont’, ‘false’,
          ‘id’, ‘flash-animations’,
          ‘name’, ‘menu’,
          ‘menu’, ‘false’,
          ‘allowScriptAccess’,‘sameDomain’,
          ‘movie’, ‘menu.swf?page=<%= HttpContext.Current.Request.QueryString[“page”] %>’,
          ‘salign’,
        );
      }
      </script><noscript></noscript>

That’s it.

Now the attached JS is slightly modified then the version you can download from Macromedia.  I simply had too many .swf files with querystring as attributes.  The script at Macromedia’s site requires you to remove the .swf - it’s annoying to remove that from all of my code.  So I edited their code.

Check out www.2220cantonlofts.com to see it working.

 

> Revision History
> About the author