Copy link to clipboard
Copied
Hi everyone, I'm trying to lower the alpha transparency of a background using Actionscript 3. The following still seems too dark: background_mc.alpha += .01; Can anyone tell me how to get this to be even more transparent? I tried: background_mc.alpha += .001; But this didn't do anything. Appreciate any advice.
Copy link to clipboard
Copied
Alpha works from 0 to 1, 0 being totally transparent and 1 being fully opaque. If you are adding to the alpha value, you are making it less transparent.
I'm not sure what you are doing using +=. If you intend it to be a statiuc transparent value, then just assign a value...
background_mc.alpha = .1;
Copy link to clipboard
Copied
Exactly what Ned said.
For reference the += operator adds to the current value.
For example:
var value:int = 6;
value += 2; // this is equal to value = value + 2
trace(value); // this will print 8 because 6 + 2 = 8
So, like Ned said.
In your example, If the value of alpha was already 0.5 or anything, and you += anything to it, you are making it less transparent.
Copy link to clipboard
Copied
Thanks for the replies,
Assigning .1 to the alpha property instead of using += has worked.
Copy link to clipboard
Copied
You're welcome