Forums / Setup & design / IE Flash Activiation

IE Flash Activiation

Author Message

declan reynolds

Thursday 11 January 2007 7:26:58 pm

Hi All,

Anyone know how to sort out the Flash Activation Bug in IE so a user does not have to click the .SWF to make it work?

Many thanks,

declan

Nuno Portugal

Tuesday 22 January 2008 11:24:52 am

Hi, I found the solution to the activation bug with javascript. Here is what i've done in version 3.8.6 and it works fine.

Save text as file withe the name "activateActiveX_onload.js"

*******************************************************************************************
/*
activateActiveX
---------------
Purpose: Dynamically replace any elements that will be affected by the new security feature in IE6/IE7 that requires a user to click certain types of elements to activate them before use.

Usage: Include this file in the <head></head> section of your html document using the following...
<script language="JScript" type="text/jscript" src="activateActiveX_onload.js"></script>

Since this script is in response to a software patent lawsuit, I feel it necessary to state the following...

License:
activateActiveX is Copyright (C) 2006 Jason Baker (therippa AT gmail.com). It is available as open source code from:
http://therippa.blogspot.com

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details http://www.gnu.org/licenses/gpl.html
*/

//trap onload event
window.onload = function () {
//Determine browser, we only need this for Internet Explorer
if (navigator.appName == "Microsoft Internet Explorer") {

//Array of elements to be replaced
var arrElements = new Array(3);
arrElements[0] = "object";
arrElements[1] = "embed";
arrElements[2] = "applet";


//Loop over element types
for (n = 0; n < arrElements.length; n++) {

//set object for brevity
replaceObj = document.getElementsByTagName(arrElements[n]);

//loop over element objects returned
for (i = 0; i < replaceObj.length; i++ ) {

//set parent object for brevity
parentObj = replaceObj[i].parentNode;

//grab the html inside of the element before removing it from the DOM
newHTML = parentObj.innerHTML;

//remove element from the DOM
parentObj.removeChild(replaceObj[i]);

//stick the element right back in, but as a new object
parentObj.innerHTML = newHTML;

}
}
}
}

**************************************************************************************************

Upload the file to /yoursite/design/standard/javascript

Edit design.ini and add the js filename =activateActiveX_onload.js

Make it as global defitnition.

NOTE: It works fine with Flash 8 content. Didn´t try with Flash 9...

Hope it gets usefull...

Lukasz Klejnberg

Tuesday 22 January 2008 1:32:52 pm

see swf object, it works very well with ez publish

http://blog.deconcept.com/swfobject/

Piotrek Karaś

Tuesday 22 January 2008 1:37:36 pm

Here's probably the most popular SWF library, that also takes care of the problem:
http://blog.deconcept.com/swfobject/
One drawback is that you require javascript for flash movies to show up, but actually IE bug requires 'outside javascript-like embedding' anyway, so... ;)

Good luck,
Piotrek

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu