Copy link to clipboard
Copied
i want to change color like above
-and my script for this is
btnCNC.addEventListener(MouseEvent.CLICK, displayCNC);
function displayCNC(e:MouseEvent):void
{
var amount:Number;
var a:Number;
var b:Number;
var c:Number;
var d:Number;
a = 1;
b = 5;
c = 1;
d = 7;
amount = (25*a)+(10*b)+(5*c)+(1*d);
lblamount.text = amount.toString();
lbla.text = a.toString();
lblb.text = b.toString();
lblc.text = c.toString();
lbld.text = d.toString();
}
Thanks agai
Copy link to clipboard
Copied
are your textfields created in the authoring environment (if yes, in the properties panel/character select the disired color) or using actionscript (if yes, use the textColor property of your textfield)?
Copy link to clipboard
Copied
If you prefer to do it by code, you can use TextFormat
ie:
lbla.text = a.toString();
lbla.setTextFormat(new TextFormat("font", size:Number, color:uint));
So if you have embedded arial font in your fla, and want the color of the text to be royal blue you could type:
lbla.setTextFormat(new TextFormat("arial", 12, 0x4876FF));