Embed fonts on classic TextField doesn't work, even with TextFormat applied
Hi.
I created an Item that extends MovieClip and that has a TextField on it where it where it will display the item's name. I want to embed the font but I'm having trouble because the text won't display.
I read the embedFonts description (http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html#embedFonts) and I have formatted the TextField via a TextFormat instance with my chosen font.
My code:
import flash.display.MovieClip;
import flash.text.AntiAliasType;
import flash.text.TextField;
import flash.text.TextFieldAutoSize;
import flash.text.TextFormat;
public class Item extends MovieClip {
private var _sName:String = "";
private var _txtName:TextField = new TextField();
private var _nColor:uint = 0xAACC00;
private var _tfText:TextFormat = new TextFormat();
public function Item(s:String) {
//also tried embedding here but got the same result
_txtName.text = s;
_txtName.autoSize = TextFieldAutoSize.RIGHT;
_tfText.font = "Helvetica";
_tfText.size = 30;
_tfText.color = _nColor;
_txtName.setTextFormat(_tfText);
_txtName.antiAliasType = AntiAliasType.ADVANCED;
_txtName.embedFonts = true;
addChild(_txtName);
}
If I remove the embed part the text shows correctly. I'm at a loss, what order of elements do I need to use to embed the font correctly?
Thank you.
