views:

841

answers:

2

Hi

I would like to tint a movieclip with the tweener class.

This is how I tint the mc without the tween:

var c:Color=new Color();

c.setTint(0xff0000, 0.8); clouds.transform.colorTransform=c;

it works but I would like to give it a smooth transition that's why I would use tweener.

Anyone have an idea?

+2  A: 

Tweener has a bunch of special properties you can tween (one of them being color). See the documentation here: http://hosted.zeh.com.br/tweener/docs/en-us/

You'll need to import/initialize the class before you can use it like so:

import caurina.transitions.properties.ColorShortcuts;
ColorShortcuts.init();

then you'll want to use the _color property like so:

Tweener.addTween(myDisplayObject, {_color: 0xff0000, alpha: 0.8, time: 2});
heavilyinvolved
this isn't exactly what I'm looking for since I'm changing a tint and not a color. Thanks for the effort though (however Iwas aware of this method to change colors with tweens,but I'm changing a tint of MovieClip: called clouds)
Ayrton
from the tweener documentation: "_color: A color that you want to set the object to. This tints the object to this new color, maintaining nothing of the original object's content colors."It tints the object... is this not what you are trying to accomplish? Did the above code not return the intended result?
heavilyinvolved
+2  A: 

Ive found Tweener to not work properly with colour tweens in AS3. I use TweenLite http://blog.greensock.com/tweenlite/:

import com.greensock.*;
import com.greensock.plugins.*;
TweenPlugin.activate([TintPlugin]);
TweenLite.to(mc, 0.8, {tint:0xff0000});
daidai
I haven't found an answer either for tweener. Thanks for the link to tweenlite. I will def. try it
Ayrton