Skip navigation
Currently Being Moderated

Embed fonts in combo box with textlayoutformat

Jun 5, 2012 1:55 PM

I've never figured out why Flash has such trouble embedding fonts in components but I can't for the life of me figure out how to with the new tlf textfields. I have my tlf text field working fine and I want to use the same format for my combo box. It works fine on the field but why not for the combo box?

 

// set format

   var myFormatBlack:TextLayoutFormat = new TextLayoutFormat();

   myFormatBlack.color = 0x990000;

   myFormatBlack.fontFamily = "Doctor Soos Bold";

   myFormatBlack.fontSize = 24;

  

   type_cb.textField.setStyle("embedFonts", true);

   type_cb.textField.setStyle("textFormat", myFormatBlack);

  

   // add status text box

   var status_txt = new TLFTextField();

   content_layer.addChild(status_txt);

   status_txt.x = 50;

   status_txt.y = 500;

   status_txt.width = 900

   status_txt.height = 24;

   status_txt.multiline = false;

   status_txt.selectable = false;

   status_txt.border = true;

   status_txt.text = "Testing!";

  

   // add text flow to text box

   var status_flow = status_txt.textFlow;

   status_flow.hostFormat = myFormatBlack;

   status_flow.flowComposer.updateAllControllers();

 
Replies
  • Currently Being Moderated
    Jun 5, 2012 2:01 PM   in reply to C-Rock

    To embed fonts in CheckBox component, ComboBox component, and a Slider component, requires that a font symbol with the linkage class name of Font1 (or whatever) exists in the library.

     

    http://www.adobe.com/devnet/flash/quickstart/embedding_fonts.html

     
    |
    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