TextLayoutImporter and creating elements from XML
I'm trying to use the functions available through the TextLayoutImporter class to create elements from XML.
For example, I would like to use this xml:
var chase_xml:XML = new XML('<p>chase</p>');
in conjunction with the "createParagraphFromXML" method of the TextLayoutImporter class to create a ParagraphElement that I can add to an existing TextFlow using the "addChild" method of the TextFlow class.
Unfortunately, I keep getting an empty paragraph rather than the paragraph I am sending into the importer.
The code I've been tinkering with:
var _headerTextFlow = new TextFlow();
//using the same config as the TextFlow I already created, since that is what I understand the purpose of the config to be? I also, unsuccessfully, tried setting it to null
var new_importer = new TextLayoutImporter(_headerTextFlow.configuration);
var spellParagraph:ParagraphElement = new_importer.createParagraphFromXML(spellXML);
trace('get text: '+spellParagraph.getText()); //this traces as 'get text: '
_headerTextFlow.addChild(spellParagraph);
Is this function just non-functional? It would be pretty useful to be able to go directly from XML marked up for the TextLayout Framework to FlowElements. I was going to try to write a class to do just that when I dug into the source and found functions such as "createParagraphFromXML." Unfortunately, they do not see to be working in a way I can understand...
