Skip to main content
Participant
March 6, 2012
Question

Question about html->TextFlow

  • March 6, 2012
  • 1 reply
  • 2488 views

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

This topic has been closed for replies.

1 reply

Adobe Employee
March 6, 2012

Are you talking about difference between <br/> and an empty line?

I think it's class XML that causes the different.