PDA

View Full Version : Transparent background for Flash animation???


peachlunaria
2-10-05, 01:49 AM
Ok...here's my problem. The website I'm creating has a gradient background. I want to craeat an animation with Flash MX, but when I choose a background color, it looks bad against my gradient background because it obviousely doesn't match. Is there any way to set the background on the flash animation to transparent? If not, what's another way around this problem?

I hope that question made sense... :confused: :confused:

markus
2-10-05, 03:16 AM
sorry there is no way to have a transparent background in flash.

One solution is to import your gradient background into flash, then match it with the html version, might take a couple of shots, but it should work.

Or again import your gradient into flash and make the browser window the size of your flash document using javascript.

Markus

satis
2-10-05, 12:25 PM
I'm sorry, but transparent backgrounds are possible.

The way to do it is modify the actual flash code that gets put into the web page (the embed portion)

here's an example (my web page flash headers)

<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
WIDTH="750" HEIGHT="100" id="header" ALIGN="">
<PARAM NAME=movie VALUE="/globals/swf/header3.swf?local_area=<?php echo $local_area; ?>">
<PARAM NAME=wmode value="transparent">
<PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF>
<EMBED src="/globals/swf/header3.swf?local_area=<?php echo $local_area; ?>" quality=high bgcolor=#F9F9F9 wmode=transparent WIDTH="750" HEIGHT="100" NAME="header" ALIGN=""
TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>
</OBJECT>

notice the <PARAM NAME=wmode value="transparent"> and wmode=transparent in the embed tag. That's how you do it.

AdamJThompson
2-10-05, 05:12 PM
Yes, the method described by "sati" works, but remember that playback speed can suffer AND not all browsers support transparent backgrounds for Flash movies.

http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=tn_14201

The list give by Macromedia is a bit dated. I'm not sure which browsers do and do not now.

Adam

peachlunaria
2-10-05, 05:37 PM
Hmmmmm...thank you for your help. I will try the method described by "sati".

peachlunaria
2-10-05, 06:08 PM
Thank you sati!! That worked!

Now, my question is...does it matter what color the background is set to since I'm making it transparent?

AdamJThompson
2-10-05, 06:27 PM
Nope. The background color won't matter. Just be sure that you don't have any objects "acting" as a background, such as a large rectangle that covers the entire stage.

markus
2-21-05, 11:36 AM
peach if you don't mind posting the page so the we can test it... because i'm with the other guy might work in some browser but not all..