Home : Internet : Website Troubleshooter : Embedded Object Activation

Press SPACEBAR or ENTER to activate and use this control

If you embed an object (such as a Flash movie or video player) in your web page, you will notice that Internet Explorer does not automatically activate the object when you visit the web page. Instead, you will get a message when you hold your mouse over the object, saying "Press SPACEBAR or ENTER to activate and use this control".

This problem is the result of a legal battle over the underlying technology. Microsoft introduced this problem on purpose to avoid litigation problems. Unfortunately the poor webmaster is left to clean up the mess.

There is a solution (or at least a workaround) which involves using an external script (usually JavaScript) to create the embedding code. If you don't want to use an external script, you're out of luck — it's the only known workaround.

The Solution

In this example we will use the following simple code for embedding a Flash object. The same technique works for any embedding code, e.g. Windows Media Player, Quicktime player, etc.

<object width="400" height="50">
<param name="movie" value="myFlashMovie.swf">
<embed src="myFlashMovie.swf" type="application/x-shockwave-flash" width="400" height="50"></embed>

Step 1: Create an external Javascript

Make a plain text file and give it a useful name with a js extension, e.g. embedflash.js

Step 2: Create the code

Use the JavaScript document.write method to create the code. In our example, we just enter this text into the JavaScript file:

document.write('<object width="400" height="50">');
document.write('<param name="movie" value="myFlashMovie.swf">');
document.write('<embed src="myFlashMovie.swf" type="application/x-shockwave-flash" width="400" height="50"></embed>');

In case you don't know what's happening, JavaScript is writing the exact same code we need to embed the object. It's not really any different to writing the code yourself into the web page, but because it uses an external script it gets around the problem. Anyway, you don't need to understand how it works, just trust me ;)

Step 3: Call the Script File

On your web page, insert the following line when you want the code to appear:

<script language="JavaScript" src="embedflash.js"></script>

Naturally you will need to edit the code in this example to suit your situation, but basically that's it. If you have any problems or questions, ask in our web design forum (but please do try it properly yourself first, and show us the URL).
Subscribe to us on YouTube