3 Replies Latest reply on Oct 7, 2009 3:42 PM by GordonSmith

    textFlow finished parsing event?

    radikalFish

      Hello

       

      i set the content of a RichText control via

      myRichText.textFlow = TextFlowUtil.importFromString(str); (inside the overridden set data funtion inside a custom itemRenderer)

       

      I need to know when it has finished the importing but i can't find the right event for that.

       

      I tried it with the RichText.updateComplete event but it gets fired 2 times in a row  which is not optimal for my situation.

      (tracing the content of the RichText inside the handler function prints 2 times the same result as well - so nothing has changed actually).

       

      --

       

      Other thing:

      the TextFlowUtil.importFromString(str) seems to be very sensible.

      i tried to import a str with a spelling mistake in one if its <br/> tags.

      the mistake was </br> instead of <br/>


      I got the an Error #1085 runtime error: TextFlow must be closed with </TextFlow>

      That's a little confusing, i would expect that it skips this "</br>" literal.

      It's very hard to find the error expecially when it's not you how writes the xml where the str comes from..

      (i've put the import in a try catch clause for a workaround but the text for this item is lost)

       

      Is this a wanted behavior or should this be treatend as a bug?

       

       

      so long

      r.F.

       

      P.S.

      I'am using build 4.0.0.10708

        • 1. Re: textFlow finished parsing event?
          David_F57 Level 5

          Hi

           

          did you try to add the update_complete listener to myRichText.textFlow  or myRichText ?

           

          David.

          • 2. Re: textFlow finished parsing event?
            radikalFish Level 1

            it's on the RichText control directly

            <s:RichText id="rT" updateComplete="onUpdateText(event)"....

             

            i tried to add a "UpdateCompleteEvent.UPDATE_COMPLETE" to the textFlow as well

            like:

            rT.textFlow.addEventListener(UpdateCompleteEvent.UPDATE_COMPLETE, onFlowUpdate);

             

            but it never gets invocted...

             

            r.T.

            • 3. Re: textFlow finished parsing event?
              GordonSmith Level 4

              There is no "textFlow finished parsing event"... when you call TextFlowUtil.importFromString() the String has already been parsed into a TextFlow by the time the method call returns the TextFlow to you.

               

              But the RichText must later render the TextFlow into TextLines. If you're using a recent version of the Flex 4 SDK in which RichText is a UIComponent, you should get an updateComplete event after this happens. If you aren't getting it, please file a bug. But in earlier versions of the Flex 4 SDK, RichText was a GraphicElement, and GraphicElements don't dispatch the "lifecycle events" that UIComponents do.

               

              Gordon Smith

              Adobe Flex SDK Team

              1 person found this helpful