What is dynActiveX.js?
dynActiveX.js is a JavaScript developed by user fproductions and posted to the Adobe Flash forum/newsgroup. The JavaScript overrides the ActiveX problem so that Flash movies are automatically activated in Internet Explorer.
How can I get dynActiveX.js?
Fairly easily. You'll have to create the file yourself; you can also Google for it, but I tend not to trust downloading scripts from unknown sources. If you'd like to just create your own, open a new NotePad file and copy the following code into it:
//dynActiveX.js is credit to Flash forum user fpproductions
// When the page loads:
window.onload = function(){
if (document.getElementsByTagName) {
// Get all the tags of type object in the page.
var objs = document.getElementsByTagName("object");
for (i=0; i<objs.length; i++) {
// Get the HTML content of each object tag
// and replace it with itself.
objs[i].outerHTML = objs[i].outerHTML;
}
}
}
// When the page unloads:
window.onunload = function() {
if (document.getElementsByTagName) {
//Get all the tags of type object in the page.
var objs = document.getElementsByTagName("object");
for (i=0; i<objs.length; i++) {
// Clear out the HTML content of each object tag
// to prevent an IE memory leak issue.
objs[i].outerHTML = "";
}
}
}
Okay, the credit tagline is my addition, but the rest of it should be copied word-for-word. In your NotePad file, click File->Save As and save the file as dynActiveX.js.
Okay, so now that I have the JavaScript, how do I use it?
First you need to add code to the file containing your Flash file, telling it to look for the external JavaScript file and make sure that its contents are executed as the page loads. Look for the <head> tag in your HTML; after the <head> tag and before the </head> tag, paste the following code:
<!--[if gte IE 6]>
<script src="dynActiveX.js"></script>
<![endif]-->
All that does is check the browser version and, if it's Internet Explorer 6 or higher, run dynActiveX.js to remove the control activation problem.
When that's finished, upload both your web page and your dynActiveX.js file to the same directory on your web server. You should be able to reload your page and display Flash movies without problems.

