Jump to content
Search Community

Can I use a var for autoAlpha value?

ngrinchenko test
Moderator Tag

Recommended Posts

I would like to find out if I can use a var for alpha values in TweenMax.

Here is what I have and it doesn't work:

var thumbFadeIn:Number = .3;

TweenMax.to(e.currentTarget.blackBox, .5,{ alpha:thumbFadeIn } );

 

The reason I tried it, because previously I used this line for scale tween, which worked:

var thumbSmall:Number = 1;
thisOne.x = thisOne.myx = (84 + padding) *item;

TweenMax.to(e.currentTarget, .5, { scaleX:thumbSmall, scaleY:thumbSmall, x:e.currentTarget.myx, y:0 } );

Link to comment
Share on other sites

Yes, you can use a var for alpha. Your first bit of code should work fine.

Very odd that it doesn't.

If you can't get it to work please post a very simple file with only the code and assets necessary to replicate the problem and I'm sure we can get it resolved.

Link to comment
Share on other sites

You are right. I tested it while making a simple file and everything has worked. Error has to be somewhere in the code not related to greensock.

I will use an actual number rather than the var in my case, since this way it works.

Thanks for offering to look into this case.

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...