• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

how do i change font color??

New Here ,
Jul 06, 2011 Jul 06, 2011

Copy link to clipboard

Copied

Untitled.jpg

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

TOPICS
ActionScript

Views

465

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 06, 2011 Jul 06, 2011

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)?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 27, 2011 Jul 27, 2011

Copy link to clipboard

Copied

LATEST

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));

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines