How to use wmode as transparent for flash and what’s its use?

Sometime our embedded flash object comes over our websites dropdown menus or over other objects like light box, jQuery Boxy, fancybox etc.

We can solve this problem by changing the wmode of embed to transparent. By changing the wmode to transparent the flash object becomes transparent.

We can do it in following ways.

HTML:-

Add the following parameter to the OBJECT tag:

<param name=”wmode” value=”transparent”>

Add the following parameter to the EMBED tag:

wmode=”transparent”

JavaScript:-

If you are using swfobject.js javascript file for embedding. Then do it like this.

<script type="text/javascript">
var obj = new SWFObject(”player.swf,”ply”,300,250,9,”#FFFFFF”);
obj.addParam(”wmode”,”transparent”);
</script>

If you want to apply the wmode transparent to whole HTML page. You can do this way.

<script type="text/javascript">
for (var ems = document.embeds, i = 0, em; em = ems[i]; i++) {
	em.setAttribute(’wmode’, ‘transparent’);
	var nx = em.nextSibling, pn = em.parentNode;
	pn.removeChild(em);
	pn.insertBefore(em, nx);
}
</script>

,


  1. #1 by shashi arya - April 2nd, 2009 at 19:40

    Also add wmode=”transparent” in embed code
    So the flash work perfectely in all the browser.

(will not be published)


Submit Comment
Subscribe to comments feed