PDA

View Full Version : [AS3] RadioButton Label Formatting - AntiAliasType


madcat
06-10-2009, 07:05 PM
I can format the labels text with:


var format:TextFormat = new TextFormat();
format.font = "Myriad Pro";
format.color = 0x336699;
format.size = 13;
format.bold = true;

group1_button.setStyle("textFormat", format);


...but the text shows up rough, no smoothing. With a text field, I can add the following:

format.embedFonts = true;
format.antiAliasType = AntiAliasType.ADVANCED;

// but have to use tf.setTextFormat(format);


How can apply the same to a RadioButton label?

If I've missed this somewhere forgive me. The 5 posts that show up in the search stop at changing the font size only.

Thanks in advance.

madcat
06-10-2009, 10:03 PM
...just realized, probably should be in AS3 instead.

Solution:

var format:TextFormat = new TextFormat();
format.font = "Myriad Pro";
format.color = 0x336699;
format.size = 13;

myRadioButton.textField.antiAliasType = AntiAliasType.ADVANCED;
myRadioButton.textField.sharpness = 100;
myRadioButton.setStyle("embedFonts", true);
myRadioButton.setStyle("textFormat", format);


Also, depending on which font you use; it will need to be added to the library by right-clicking and linking it to your movie and exporting to frame 1.

Hope this helps someone else.

M