• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Transparency values

Contributor ,
Feb 03, 2011 Feb 03, 2011

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.

TOPICS
ActionScript

Views

509

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 03, 2011 Feb 03, 2011

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;

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 04, 2011 Feb 04, 2011

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 04, 2011 Feb 04, 2011

Copy link to clipboard

Copied

Thanks for the replies,

Assigning .1 to the alpha property instead of using += has worked.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 04, 2011 Feb 04, 2011

Copy link to clipboard

Copied

LATEST

You're welcome

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines