After transform.colortransform on mc, can't change textfield's color within mc

680 views Asked by At

I'm trying to change the color of a textfield that is inside of a movie clip, in a game. I change the color of the movie clip using this:

var newColor:ColorTransform = new ColorTransform();//color change

newColor.color = 0x000000;

circle.transform.colorTransform = newColor;

This works fine. However, I have added a textfield to circle, using this.addChild(), called A (public var A:TextField = new TextField(), which I have set to have a white color). When I try to change the color of the text of A, using A.textColor = 0xFFFFFF, after using transform.colortransform, the color of the circle is still black and A becomes black too. No matter how often I call to change A's text color, it stays black.

Any one have any idea about what could be going wrong?

Thanks, FF

1

There are 1 answers

2
Jeff Ward On

ColorTransforms are applied to all contents (and children) of a MovieClip. It doesn't matter what color the TextField (or any other DisplayObject child) is, it will all render black. Your options are:

  • Apply the black colorTransform not to the parent MovieClip, but to the circle you want to turn black.

  • Move the TextField out of the parent MovieClip

This is the same as geometric transforms - if you rotate the parent movieclip, the children inside are all rotated accordingly.