Jump to content
Search Community

alpha vs autoAlpha?

Guest aezzell
Moderator Tag

Recommended Posts

autoAlpha effects an object's visible property as well as alpha.

 

this is handy when you want to fade out a button that responds to mouse events.

 

if you do an alpha tween to alpha:0 on a button, it will be fully transparent, but still clickable.

 

if you do an autoAlpha:0, it will fade the alpha to 0 and in addition set the visible to false when the fade is done.

 

http://www.greensock.com/as/docs/tween/ ... lugin.html

Link to comment
Share on other sites

I wouldn't call using alpha instead of autoAlpha a benefit :)

 

Basically when the object is fully-transparent the object is still present in the display list and Flash still needs to draw the transparent pixels of your object.

 

Performance-wise, if you don't need your object to be able to respond to mouse events, such as ROLL_OVER, CLICK etc., it's much better to use autoAlpha instead, since autoAlpha sets your object's visible property to false at the end of the tween, thus preventing its transparent pixels from being drawn anymore, until you set the object to autoAlpha:1

 

Does that make sense?

Link to comment
Share on other sites

Guest aezzell

Thanks, guys.

 

Is this correct?

 

autoAlpha is activated by default in TweenMax. So if you're already using TweenMax, there's no benefit to using alpha. (Unless for some reason you want things you can't see to respond to MouseEvents).

 

But if you're only using TweenLite, there's some small size benefit to just using alpha, and setting visible to false if having it true might cause a problem.

 

Yes?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...