user3273190
user3273190

Reputation: 21

Change the fontsize of a button's label in Actionscript 3.0

Can someone help me change the fontsize of a button's label in actionscript 3? I have a button called "submit" from the components and I was able to change its font using the "setStyle"...But I don't know how to change its fontsize. Is there a code similar to what I have just made? Below is the code on how I change the fontstyle. Any help will be very much appreciated..

submit.label = "Submit";
submit.setStyle("textFormat", new TextFormat("Impact"));

Upvotes: 1

Views: 1541

Answers (1)

BadFeelingAboutThis
BadFeelingAboutThis

Reputation: 14406

The second parameter in the TextFormat constructor is for the font-size:

submit.setStyle("textFormat", new TextFormat("Impact", 24));  //would give a font size of 24 pixels

See the documentation for other parameters such as text alignment, bold, underline etc..

Upvotes: 1

Related Questions