Problem with TextConverter.importToFlow
Hi !
I am getting better thanks to the first response of Richard on my first post. And now format and applying format is not anymore a problem for me
!
But now I have a little problem with the TextConverter.importToFlow ![]()
The aim : A user create his own text by editing/pasting, and changing style. Then he save it. So I convert my textflow in a xml and save an XML file.
Then he open this file. So I have to convert the xml into a TextFlow type to display it in my AIR application.
My XML : (details)
<note>
<TextFlow columnCount="inherit" columnGap="inherit" columnWidth="inherit" lineBreak="inherit" paddingBottom="inherit" paddingLeft="inherit" paddingRight="inherit" paddingTop="inherit" verticalAlign="inherit" whiteSpaceCollapse="preserve" xmlns="http://ns.adobe.com/textLayout/2008">
<p><span>Tout animal (l'homme y compris) qui vient de manger depense dans les heures qui suivent une energie</span>
<span textDecoration="underline">importante consacre</span>
<span>a sa digestion stomacale.</span>
</p>
</TextFlow>
</note>
My problem is :
I don't know why but i can't do
myXML.TextFlow
or
myXML.child("TextFlow").
An error compil appears (null reference).
After few tests, I found that xmlns="http://ns.adobe.com/textLayout/2008" TextFlow's argument is the source of the error compil.
But I have to give only the balise <TextFlow> to the method importToFlow without the <note>. What I am suppose to do? I cant access to the <TextFlow> balise...
public function updateDetails( details:XML ) : void
{
if (details != null)
{
var loadTextFlow:TextFlow = TextConverter.importToFlow(details.toString(), TextConverter.TEXT_LAYOUT_FORMAT);
_textFlow = loadTextFlow;
_textFlow.interactionManager = new EditManager(new UndoManager());
_textFlow.interactionManager.selectRange(0,0);
_textFlow.flowComposer.updateAllControllers();
_textFlow.interactionManager.setFocus();
}
}
Thank you for your help ![]()
