Using Transparency

You can set and alter the transparency of any item you add to your swf movie. We do this by adding an extra value to our color codes so that we have four digits for RGBA or Red Green Blue Alpha where Alpha=transparency from 0-255 just like the color values.

At this time, there is no way to add transparency to the background color of a swf movie created with Ming, but there may be a workaround in the future.

Let's hide some text behind a box, then slowly make the box transparent showing our hiding text.

A) Begin as always by starting your HTML page and opening your php code block.

B) Next, we define our font and create our text as usual Download font

$myFont=new SWFFont("Arioso.fdb");
$myText1=new SWFText();

C) Then, add our box shape as normal

$myShape2=new SWFShape();

D) Now, we define our swf movie and set it's attributes as always

$myMovie=new SWFMovie();

E) Next, we add our text to our movie, then our box shape. Whichever item is added first will be the bottom layer, and each item added after it will be layered over previous items.


F) Now, we use our multColor function in a loop from lesson 9, but change the Alpha channel instead of one of the RGB channels

for($i=0; $i<20; $i++){

G) Finally, we save our movie, close our php code block, and add our html object coding as always.


<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase=",0,0,0" ID=objects WIDTH=300 HEIGHT=200>
<PARAM NAME=movie VALUE="lesson13.swf">
<EMBED src="lesson13.swf" WIDTH=300 HEIGHT=200 TYPE="application/x-shockwave-flash" PLUGINSPAGE="">

Transparency combined with gradients and the use of the multColor function can create truly awe inspiring transformations!

Code summary for lesson 13: Result: