Skip to content


AS3 embedding fonts and TextFormat

A few days ago I had a problem with using a font from the library (which is in the .fla) in a class file (which is an .as).
If you have created a font in your .fla by Library>New>New Font, use it's name like below in the class file to use it:

var format3:TextFormat = new TextFormat();
format3.font = "BM mini";
format3.color = 0x6AB779;
format3.size = 20;
format3.bold = true;
format3.align = TextFormatAlign.LEFT;

Now, this is the usual TextFormat use, to use this new format on a TextField object, I thought I would use "defaultTextFormat = format" as usual. Wrong. defaultTextFormat did not work, however, setTextFormat(format) works:

myTextField.setTextFormat(format3);

Posted in Actionscript.

Tagged with , .


One Response

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. Kelly Brown says

    The article is very good. Write please more



Some HTML is OK

or, reply to this post via trackback.