Color is defined as a style, not as a normal property.
You want to do similar to the following:
tagLabel.setStyle("color", 0x1B82A1);
--- In [email protected], "Body Works Studio"
<[EMAIL PROTECTED]> wrote:
>
> Hello All. I have been asked to color the text in a series of buttons
> in a color series (blue, then green, then grey, then repeat). The
> buttons are being dynamically made via an array that the script reads.
> I can create the button, set the label, and set the alpha, but when I
> get to color, flexbuilder throws a 1119 error.
>
> here is my code
>
> var tagLabel:Button = new Button();
> tagLabel.label = word;
> tagLabel.alpha = 0.0;
> tagLabel.toolTip = Constants.RELEVANCE + ": " + tagScore.toFixed(2)
+ "%"
> //Color Font
> if (colorIdx == 0)
> tagLabel.color = 0x1B82A1;
> tagLabel.
> else if (colorIdx == 1)
> tagLabel.color = 0xA9CCC1;
> else
> tagLabel.color = 0x7F8080;
>
> all three lines defining .color have an error of 1119: Access of
> possibly undefined property color through a reference with static type
> mx.controls:Button.
>
> Any ideas.
>
> Thanks
>
> Jeff
>