Embedding Fonts in AS3 Components
Flash components have traditionally been terrible to work with. The new ones in AS3 are much better than the previous AS2 ones, but there are still some frustrating parts to them. I recently created a form using the AS3 components, which uses an alpha tween to fade from page to page. However, when I tween the form page, which contains components, the text on all the form items does not tween (meaning the font is not embedded - this also happens if you use a dynamic text field and do not embed the font). It seems like it would be simple enough but at least in my situation the obvious does not work:
var myFormat:TextFormat = new TextFormat();
myFormat.font = “Univers 55″;
myFormat.size = 11;
myFormat.color = 0×333333;
//buttons
myRadio.setStyle(”textFormat”, myFormat);
myRadio.setStyle(”embedFonts”, true);
Right? Wrong. Something is missing. The font won’t embed, particularly with RadioButtons and ComboBoxes. Here’s the kicker - you must embed the font in the library.
1. Go to your library panel and click on the tiny menu on the top right.
2. Select “New Font” (don’t feel bad if you didn’t know it that was there, me either).
3. Select the font you are using, and size.
4. Make sure to set the Linkage “Export for Actionscript.”
With AS3, one thing is for certain - you learn something new everyday.













