问题
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"));
回答1:
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..
来源:https://stackoverflow.com/questions/25655852/change-the-fontsize-of-a-buttons-label-in-actionscript-3-0