Skip to main content
Participant
October 22, 2011
Question

Applying font type to radio buttons

  • October 22, 2011
  • 1 reply
  • 965 views

How do you apply a font type to a radio button.  I thought I was doing it correctly, but it keeps showing as Arial.

I've embedded the font as AirCruiser and given it a class name.

I use the following code:

var font:AirCruiser=new AirCruiser();

 

var myformat:TextFormat = new TextFormat();

myformat.color = 0xFFFFFF;

myformat.font = font.fontname;

myformat.size = 48;

 

normalButton.setStyle("textFormat", myformat);

hardButton.setStyle("textFormat", myformat);

suicidalButton.setStyle("textFormat", myformat);

It takes the color and the size, but the font remains arial.

Any ideas what I'm doing wrong?

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
October 22, 2011

you're not embedding the buttons' font and fontname should be fontName:

var font:AirCruiser=new AirCruiser();

 

var myformat:TextFormat = new TextFormat();

myformat.color = 0xFFFFFF;

myformat.font = font.fontName;

myformat.size = 48;

 

normalButton.setStyle("embedFonts",true);  // etc

normalButton.setStyle("textFormat", myformat);

hardButton.setStyle("textFormat", myformat);

suicidalButton.setStyle("textFormat", myformat);