Removing Internet Explorer’s Active Content Warning on Flash Objects

By  on  

A couple of years ago Internet Explorer cause millions of programmers and users alike a giant pain by making users click on a flash object, ActiveX object, and java applet before the object became active and usable. Businesses, of course, cried out for their programmers to fix the problem and programmers pulled their hair out for weeks. As one of those programmers, I can tell you that businesses wont take "Microsoft screwed things up" for an answer and luckily I found a solution that works without requiring that the user do anything.

The solutions requires the use a small JavaScript file strategically placed immediately after the Flash object's </object> tag.

The File

flash-fix.js

The Code

Simply code your <object> code as usual:


width="200" height="100">





name="my_animcation" width="200" height="100" src="graphics/myanimation.swf" bgcolor="#FFFFFF" quality="high" swliveconnect="true" allowscriptaccess="samedomain">

That's all you have to do. The JavaScript code grabs the object and sets the object's outerHTML equal to itself, thus nullifying IE's effort to annoy the user.

Recent Features

  • By
    Regular Expressions for the Rest of Us

    Sooner or later you'll run across a regular expression. With their cryptic syntax, confusing documentation and massive learning curve, most developers settle for copying and pasting them from StackOverflow and hoping they work. But what if you could decode regular expressions and harness their power? In...

  • By
    Animated 3D Flipping Menu with CSS

    CSS animations aren't just for basic fades or sliding elements anymore -- CSS animations are capable of much more.  I've showed you how you can create an exploding logo (applied with JavaScript, but all animation is CSS), an animated Photo Stack, a sweet...

Incredible Demos

  • By
    Image Data URIs with PHP

    If you troll page markup like me, you've no doubt seen the use of data URI's within image src attributes. Instead of providing a traditional address to the image, the image file data is base64-encoded and stuffed within the src attribute. Doing so saves...

  • By
    dat.gui:  Exceptional JavaScript Interface Controller

    We all love trusted JavaScript frameworks like MooTools, jQuery, and Dojo, but there's a big push toward using focused micro-frameworks for smaller purposes. Of course, there are positives and negatives to using them.  Positives include smaller JS footprint (especially good for mobile) and less cruft, negatives...

Discussion

  1. Ben Hernandez

    These directions are not clear for a non-programmer. Can you help me? I’m using Dreamweaver 8.

  2. Wow that code fixed my problem. Thank you so much!

  3. hi, i was trying to solve this problem, and i couldn’t download the flash-fix script… would you please upload it again? thx

  4. Kenneth Armstrong

    I was a little confused by this. What is the code and where to I place it exactly?

Wrap your code in <pre class="{language}"></pre> tags, link to a GitHub gist, JSFiddle fiddle, or CodePen pen to embed!