1.5 days trying to read TextFlow back from database
I'm experimenting with a TextArea that has a textFlow
<s:TextArea id="mytextarea">
<s:textFlow>
<s:TextFlow id="mytextflow">
</s:TextFlow>
</s:textFlow>
</s:TextArea>
I'm trying to load into it TextFlow data that's stored in a database. It looks like this in the database, but I've removed many of the properties to make it more readable here.
<TextFlow xmlns="http://ns.adobe.com/textLayout/2008">
<p direction="ltr" >
<span>some text</span>
<span >some additional text</span>
<span> and some additional text</span>
</p>
<p direction="ltr" >
<span>some text</span>
<span>some additional text</span>
<span> more text</span>
</p>
</TextFlow>
I get this TextFlow as one of several data from the database, all in XML format, so the output Flex receives looks like this.
<?xml version="1.0" encoding="utf-8"?>
<data1>this is data 1</data1><data2>this is data 2</data2>
<data3>
<3a>this is data 3a</3a>
<3b>this is data 3b</3b>
<3c>
<TextFlow xmlns="http://ns.adobe.com/textLayout/2008">
<p direction="ltr" >
<span>some text</span>
<span>some additional text</span>
<span> and some additional text</span>
</p>
<p direction="ltr">
<span>some text</span>
<span>some additional text</span>
<span> more text</span>
</p>
</TextFlow>
</3c>
</data3>
When the data returns, I can read all the other data correctly, except data3->3c which contains the TextFlow. I've tried these among many other things, but nothing works.
mytextarea.textFlow =
TextConverter.importToFlow(event.result.data3.3c, TextConverter.TEXT_LAYOUT_FORMAT);
mytextarea.textFlow =
TextFlowUtil.importFromXML(event.result.data3.3c, "preserve");
mytextarea.textFlow =
TextFlowUtil.importFromXML(event.result.data3.3c.TextFlow[0], "preserve");
It's frustrating, I'm new to TLF, but I can't see what's wrong with this approach. Any help appreciated.
