Embedding Dynamic Fonts

Hello

I am Trying to load fonts dynamically from an XML file the code is working fine if I am using it directly on the timeline.


*var myFont:Font = new Font1();
var textFormat:TextFormat = new TextFormat();
textFormat.font = myFont.fontName;
textFormat.size = 26;
var flashText:TextField = new TextField();
flashText.autoSize = TextFieldAutoSize.LEFT;
flashText.defaultTextFormat = textFormat;
flashText.embedFonts = true;
flashText.x = 25;
flashText.y = 30;
flashText.antiAliasType = AntiAliasType.ADVANCED;
flashText.text = “Text Example A”;
addChild(flashText);*
*

*but when I am trying to load from an XML file it does’t display anything if I remove text.embedFonts = true then I can see the font any idea about this error *

Thanks in advance.