Flash Script – Create a Transparent Flash Movie

Tweet


type = 'application/x-shockwave-flash'
data = 'http://sitepointstatic.com/flash/transparent.swf'
width = '400'
height = '400'
bgcolor = 'black'
>

The background of a Flash movie can be set to display as transparent.

The swf file on the left is not transparent. The swf file on right is set to transparent. This script works only in IE 3.0 and above. It does not work in Netscape.

Transparency allows the background color or image of the HTML page that contains the Flash movie to show through.

To make a transparent movie is very simple. Just add the wmode attribute and set it to transparent, as below.

<EMBED src=transparent.swf width=120 height=30 type="text/html;  
charset=iso-8859-1" bgcolor="#000000" wmode="transparent"  
quality="high"> </EMBED>

Download the sample files here.

Simple!

Get your free chapter of Level Up Your Web Apps with Go

Get a free chapter of Level Up Your Web Apps with Go, plus updates and exclusive offers from SitePoint.

No Reader comments