My new friend setTint

I played around today with a method named setTint from the fl.motion.Color class. At first I was a bit confused because this method doesn't return anything contrarily to the interpolateColor method which returns a color in hexadecimal. You have to use setTint in this way:

Actionscript:
  1. import fl.motion.Color;
  2. import flash.geom.ColorTransform;
  3. var ct:Color = new Color();
  4. ct.setTint(0xFF0000, 0.5);
  5. mc.transform.colorTransform = ct;

With mc being the displayObject you want it applied on. setTint can be pretty useful for setting a tint on a bitmap and it can also be used with tweens in the same way I used the interpolateColor in a previous post.

One Response to “My new friend setTint”

  1. Bruno Says:

    hello
    thank you very much for this tip. i will use to it to recreate my web site.

Leave a Reply


Close
E-mail It