# \[Flash 8\] Using Tween-class with setTransform?

**URL:** <https://forum.kirupa.com/t/flash-8-using-tween-class-with-settransform/181084>\
**Category:** flash\
**Created:** [March 6, 2006, 10:30am UTC](https://forum.kirupa.com/t/flash-8-using-tween-class-with-settransform/181084 "2006-03-06T10:30:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rasper](https://avatars.discourse-cdn.com/v4/letter/r/9fc29f/32.png) [@Rasper](https://forum.kirupa.com/u/Rasper)\
**Post date:** [March 6, 2006, 10:30am UTC](https://forum.kirupa.com/t/flash-8-using-tween-class-with-settransform/181084/1 "2006-03-06T10:30:44Z")

</div>

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: )

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

```
