Jump to content
Search Community

TweenMax tint or colorTransform is turning elements black

4foot30 test
Moderator Tag

Recommended Posts

Hello all,

 

I'm tinting various movieClips etc. with code like:

 

TweenMax.to(clip,duration,{tint:hexValue, ease:linear.easeNone});

 

But on some occasions the movieClip is turning completely black. I'm guessing that this is down to attempting to remove a tint from a movieClip that doesn't yet have a tint (my timings are misfiring I think).

 

Can anyone shed any light on this, or perhaps tell me if there's a way to detect if an object has a tint before trying to run the tint removal code on it?

 

I can't find anything in the docs regarding this.

 

Many thanks,

 

Gareth Jones

Link to comment
Share on other sites

Actually, colorTransform stuff doesn't stack like that - it doesn't matter if you tween the tint to a different color 5 times in a row - it should always tint to the exact color you specify regardless of any previous colorTransform/tint stuff that's applied. If you're getting a black result, I'm guessing that either your "hexValue" is 0 or a negative number. Have you tried using trace() right before the tween to make sure it's a valid value? If you're still having trouble, please post a sample FLA that demonstrates the funky behavior.

Link to comment
Share on other sites

If you're wanting to make something REALLY red, blue, green, whatever use a colorMatrixFilter with colorize and amount. The higher the amount the more of that color it will add to the target.

 

TweenMax.to(mc, 1, {colorMatrixFilter:{colorize:0xff0000, amount:3}});

 

 

You can also use a colorTransform (which may be destructive because it's not a filter).

 

In this case running this will make the target completely red (tintAmount ranges from 0 to 1)

 

TweenMax.to(mc, 1, {colorTransform:{tint:0xff0000, tintAmount:1}})

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