1 Reply Latest reply on Dec 22, 2009 11:14 AM by Trojan84

    TextField Event

    Flex_ Level 1

      When the user updates a text in a text field and move the cursor  out of the text field or out of focus from text field, I need to fire the update event.

       

      The update event has to be fired only when the user updates the text.

       

      How to implement this .. please show some pointers. Thanks in advance.

        • 1. Re: TextField Event
          Trojan84 Level 1

          You can do this

          When your page loads you need to do a function or another Event needs to call a function to add an eventlistener to the test text. you add the focusEvent.focus_out and add a function for it to do something.

          <mx:Canvas
              xmlns:mx="http://www.adobe.com/2006/mxml"
              backgroundColor="#333333"
              creationComplete="onCreationComplete()"
          >

          import mx.controls.Alert;

           

          public function onCreationComplete():void

          {

          test.addEventListener(FocusEvent.FOCUS_OUT, popup);

          }

           

          public function pop(E:Event):void

          {

               Alert.show("Error","Error", 4.0, Somethingbox);

          }

           

          <mx:VBox id="Somethingbox">

          <mx:TextInput id="test" width="100%"/>

          </mx:VBox>

           

          </mx:Canvas>

           

          Hope it helps mark it if it answers your question.