Pages

Wednesday, July 21, 2010

How to solve the Layer Problem of Flash Objects

On a DHTML page containing several layers, a Flash object may display above all the layers, no matter what the "z-index" is. The fault is not the developers', but the browsers'.

This problem can be solved by using the "wmode" parameter to allow layering of Flash content with DHTML layers. The values of the "wmode" parameter can be "window" which is the default value, "opaque", or "transparent". "opaque" or "transparent" as the value of "wmode" parameter can prevent a Flash object from showing in the topmost layer.

The sample code:

<object>
<param name="wmode" value="transparent"></param>
<param name="movie" value="flashBanner.swf"></param>
<embed src="flashLeftBanner.swf" type="application/x-shockwave-flash" wmode="transparent"></embed>
</object>

No comments:

Post a Comment