Jump to content
Search Community

Tweenlite.from with Tint

Rabies test
Moderator Tag

Recommended Posts

I've used the following line and it works, it makes the clip go from black to normal.

 

TweenLite.from(mc,1,{tint:0x000000, ease:Linear.easeNone});

 

However, if I first made the clip fade to black, using this:

 

TweenLite.to(mc,1,{tint:0x000000, ease:Linear.easeNone});

 

Later, when I try to use the "from" version, like above, nothing happens.

 

Now, I know "removeTint" would then work, but it makes for some complications, whereas otherwise I could just use "from" to fade from black, and "to" to fade to black.

 

Do you have any further insight ? Maybe I'm overlooking a technique that would make it that easy.

Link to comment
Share on other sites

When you do a from() tween, it takes the CURRENT values and uses them as the end/destination. For example, if mc is at x:100 and you TweenLite.from(mc, 1, {x:0}) then mc.x will go from 0 to 100 (ending at the current x value). So if you tween your object to black and then TweenLite.from(mc, 1, {tint:0x000000}) it will tween from black to the current value which is also black, so it won't look like anything happens. See what I mean? It's not a bug or problem with the tweening engine - it's just a logic issue.

 

You can TweenLite.to(mc, 1, {tint:null}) if you want. It's just like doing a removeTint:true.

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