0 Replies Latest reply on Aug 25, 2009 3:36 AM by Marc Speck

    RichEditableText.content has changed?

    Marc Speck Level 1

      How can I find out whether the content of RichEditableText has changed? When running the sample below, the textFlow.generation number is changed after reading the generation the first time. Any hints?

       

      Thanks,

      Marc

       

      <?xml version="1.0" encoding="utf-8"?>
      <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/halo" 
                     minWidth="1024" minHeight="768"
                     applicationComplete="application1_applicationCompleteHandler(event)"
                     >
          <s:layout>
              <s:VerticalLayout/>
          </s:layout>
          <fx:Script>
              <![CDATA[
                  import flashx.textLayout.elements.TextFlow;
                  import flashx.textLayout.conversion.TextConverter;
                  import mx.events.FlexEvent;
                  
                  private var textFlow:TextFlow
                  protected function application1_applicationCompleteHandler(event:FlexEvent):void
                  {
                      var init:XML = <TextFlow xmlns="http://ns.adobe.com/textLayout/2008"><p><span>aaa</span></p></TextFlow>
                      textFlow = TextConverter.importToFlow(init, TextConverter.TEXT_LAYOUT_FORMAT)
                      ret.content = textFlow
                      // the same with ret.textFlow = textFlow
                      printGeneration()
                  }
                  
                  private function printGeneration():void {
                      info.text += textFlow.generation + "\n"
                  }
      
              ]]>
          </fx:Script>
          
          <s:RichEditableText id="ret" width="200" height="200" />
          <s:TextArea id="info" width="200" height="200" />
          <s:Button label="print generation" click="printGeneration()" />
      </s:Application>