在ActionScript 3.0中更改按钮标签的字体大小

问题描述:

有人可以帮我更改动作脚本3中按钮标签的字体大小吗? 我从组件中有一个名为提交"的按钮,我能够更改它 字体使用"setStyle" ...但是我不知道如何更改其字体大小.在那儿 类似于我刚刚编写的代码?下面是有关如何更改字体样式的代码.任何 帮助将不胜感激..

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

TextFormat构造函数中的第二个参数用于字体大小:

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..