Copy link to clipboard
Copied
Hi all.
Does anybody know why this is works:
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
creationComplete="onComplete(event)">
<fx:Script>
<![CDATA[
import flashx.textLayout.conversion.TextConverter;
import mx.events.FlexEvent;
private var xml:XML=
<p color="0x336699">
<b/>
The Text Framework is an extensible lie typography on the web.
</p>
;
private function onComplete(e : FlexEvent) : void
{
trace(xml);
richText.textFlow = TextConverter.importToFlow(xml, TextConverter.TEXT_FIELD_HTML_FORMAT );
//richText.textFlow = TextFlowUtil.importFromXML(xml);
}
]]>
</fx:Script>
<s:BorderContainer top="10" left="10" right="10" bottom="10">
<s:RichEditableText id="richText" />
</s:BorderContainer>
</s:Application>
,but this doesn't:
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
creationComplete="onComplete(event)">
<fx:Script>
<![CDATA[
import flashx.textLayout.conversion.TextConverter;
import mx.events.FlexEvent;
private var xml:XML=
<p color="0x336699">
The Text Framework is an extensible lie typography on the web.
</p>
;
private function onComplete(e : FlexEvent) : void
{
trace(xml);
richText.textFlow = TextConverter.importToFlow(xml, TextConverter.TEXT_FIELD_HTML_FORMAT );
//richText.textFlow = TextFlowUtil.importFromXML(xml);
}
]]>
</fx:Script>
<s:BorderContainer top="10" left="10" right="10" bottom="10">
<s:RichEditableText id="richText" />
</s:BorderContainer>
</s:Application>
???
Thx.
Andrew
Copy link to clipboard
Copied
Are you talking about difference between <br/> and an empty line?
I think it's class XML that causes the different.