Skip to main content

Using library embedded fonts in Actionscript 3.0 / 2.0

This is a small tutorial on how to use embedded fonts in the library with Actionscript 3.0 / 2.0.

You have to follow the next 4 steps to correctly embed and use library fonts in your code.

1. Add the font to the library - right click the library panel and select 'New Font'. From the 'Font' drop down select the font you want to embed and give it a name in the 'Name' field. The name can be the same with the font.

2. Right click on the newly added font in the library, select 'Linkage' and check the 'Export for ActionScript' check box. Click 'Ok' to aplly the new settings.

3. Select the text field that you want to use the embedded font for and choose the correct font from the font list in the property panel. You will be able to distinguish the library embedded fonts because of the asterisk mark (*) that will appear next to the name on the right.

4. In your actionscript code, you will need to set the embedFonts property of the text field to 'true'. Example:
mytxt.embedFonts=true;
(assuming that mytxt is the name of the text field that you assigned in the properties panel)

For using embedFonts with controls you need to follow the first 3 steps and then apply the embedFonts property in the following manner:
mycontrol.setStyle("embedFonts", true);

cant you please tell me how

cant you please tell me how to do it when you create a textField with actionscript 3 (tFmt.font = "myFont"...). Tks a lot

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. Beside the tag style "<foo>" it is also possible to use "[foo]". PHP source code can also be enclosed in <?php ... ?> or <% ... %>.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
7 + 1 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.

If you need more help on the topic feel free to add a comment or create a new post on the Forum