简体   繁体   English

AS3:更改单选按钮中的字体

[英]AS3: change Font in Radio button

如何更改Flash Professional默认组件中现有的单选按钮中使用的字体?

To change the font of your RadioButton component label, you can use the RadioButton.setStyle() function to set the TextFormat which will be applied to the label (a TextField object) of the RadioButton component. 若要更改RadioButton组件标签的字体,可以使用RadioButton.setStyle()函数设置TextFormat ,该TextFormat将应用于RadioButton组件的标签(TextField对象)。

For that, you can do like this for example : 为此,您可以这样做,例如:

var text_format:TextFormat = new TextFormat();
    text_format.font = 'Verdana';
    text_format.color = 0xff0000;

RadioButton(radio_button).setStyle('textFormat', text_format);

you can also apply that directly to the label using the RadioButton.textField property which return the TextField object : 您还可以使用RadioButton.textField属性将其直接应用于标签,该属性返回TextField对象:

RadioButton(radio_button).textField.setTextFormat(text_format);

Hope that can help. 希望能对您有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM