Skip navigation
Currently Being Moderated

Applying font type to radio buttons

Oct 22, 2011 8:44 AM

Tags: #help #font #flash #text #as3 #button #actionscript #actionscript3 #actionscript_3.0 #radio

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?

 
Replies
  • kglad
    62,004 posts
    Jul 21, 2002
    Currently Being Moderated
    Oct 22, 2011 9:04 AM   in reply to JohnCressman

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

     

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points