OK, so i think i am going crazy again and have spent way too much time on something simple, so please help my sanity.
below is some code that changes the tint of a movie clip on the stage with no problem, but my problem is i want to change a colors tint and store that color for later use to apply to dynamically created sprites, for some reason the code changes my place graphic as expect but when i draw a square using the Colortransform.color property the color always in gray scale??? i am so confused.
package{
import flash.display.*;
import flash.geom.*;
public class ColorTinter extends MovieClip{
public function ColorTinter():void{
var tint = 127.5;
var cT:ColorTransform = new ColorTransform();
cT.color = 0xFF0000;
cT.redOffset += tint;
cT.greenOffset += tint;
cT.blueOffset += tint;
square_mc.transform.colorTransform = cT;
this.graphics.beginFill(cT.color, 1);
this.graphics.drawRect(0, 0, 100, 100);
this.graphics.endFill();
}
}
}
and here is source --> http://troyblank.com/temp/ColorTinter.zip
and here is swf -->http://troyblank.com/temp/ColorTinter.swf (one on right is place square)