Question

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?

Was it helpful?

Solution

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});

OTHER TIPS

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});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top