Hi there,
I’m getting the hang of using the Tween class, which is a great for easily creating animations with fades. You can use it to tween _x, _y, _width, _alpha …
But now I would like to use the same Tween class to animate the setTransform method. So the Color of a MovieClip is changed in an animation. More concrete: I want to animate a picture so it fades from bright white to the original colors. So I would have to use the setTransform to animate the color (=tint) values from 255 -> 0. I don’t want it to be a boring linear animation, but with a fade.
My question now is whether it is possible to somehow add a feature to the Tween class to use it for the setTransform method? I never rewrote an existing AS class before. How do I do something like that?
Thanks in advance.
(here is my current code without a fade: )
var kleur:Number = 255;
var changeColor:Number = setInterval(fadein, 10, target_mc);
function fadein(target_mc:MovieClip){
kleur -= 5;
var my_color:Color = new Color(target_mc);
var myColorTransform:Object = { rb: kleur, gb: kleur, bb: kleur };
my_color.setTransform(myColorTransform);
if(kleur == 0){
clearInterval(changeColor);
}
}