nagki
asked on
Changing the wmode of flash on the fly with javascript
Hi,
I have a drop-down in a page that's coming over flash with default wmode.
After a long search, I read in the Adobe site that the only solution to get other DHTML layers over flash is setting wmode="transparent" . But, setting "wmode" to "transparent" is taking around 20%CPU always.
So, I am trying a way to set wmode on the fly with JavaScript. so, whenever needed , I will change the wmode to transparent and revert it back once done.
I tried this :
document.getElementById("F lashChart" ).setAttri bute("wmod e","transp arent"); //FlashChart is the name of the flash given in embed tag
But its not working..Any Idea?
I have a drop-down in a page that's coming over flash with default wmode.
After a long search, I read in the Adobe site that the only solution to get other DHTML layers over flash is setting wmode="transparent" . But, setting "wmode" to "transparent" is taking around 20%CPU always.
So, I am trying a way to set wmode on the fly with JavaScript. so, whenever needed , I will change the wmode to transparent and revert it back once done.
I tried this :
document.getElementById("F
But its not working..Any Idea?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
function changeWMode(id, wmode)
{
var el = document.getElementById(id
var child = null;
var param = el.createElement('param');
param.name = 'wmode';
param.value = wmode;
el.appendChild(param);
for (var i=0, end = el.childNodes.length; i < end; i++)
{
child = el.childNodes[i];
if (child.nodeName === 'EMBED')
{
child.wmode = wmode;
}
}
}