Skip navigation
Currently Being Moderated

Question about html->TextFlow

Mar 5, 2012 7:14 PM

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

 
Replies
  • Currently Being Moderated
    Mar 5, 2012 9:17 PM   in reply to voland62

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

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

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points