I have this code
public function TalentBox(x:int, y:int, arg_color:int = 0xFFFFFF):void
{
this.graphics.beginFill(arg_color);
this.graphics.lineStyle(1.0, 0x000000, 0.7);
this.graphics.drawRect(0, 0, 7, 13);
this.alpha = 1.0;
this.x = x;
this.y = y;
this.graphics.endFill();
}
Where I construct the class (that extends from sprite). Then I need to have a function that changes the color of the sprite. Currently I have this
public function setColor(arg_color:int):void
{
color = arg_color;
this.graphics.beginFill(color);
this.graphics.drawRect(0, 0, 7, 13);
this.graphics.endFill();
}
And It seems to work but this is creating a new rect. Which I do not want.
And I have tried ColorTransform, and that changes everything, even the border, which is not what I wanted. And I am not able to colortransform and then set the border color.
So how can I change the color of a sprite without changing the border color?