2 Replies Latest reply on Aug 9, 2010 10:24 PM by mike_morales

    TextInput Component event is not working....

    jerry98225 Level 1

      Hi guys...

         I am working on a AS3 only project in Flex....I tried to listen ENTER event when use clicks enter/return in my textinput box....but it seems not working well...I did try using TextEvent.TEXT_INPUT and it worked fine but not Component.ENTER...any help??? Thanks a lot!!

       

      searchInput=new TextField();

      searchInput.type=TextFieldType.INPUT;

      searchInput.background=true;

      searchInput.backgroundColor=0xecffee;

      searchInput.defaultTextFormat=TF;

      searchInput.width = 200;

      searchInput.height=16;

      searchInput.x=50;

      searchInput.y=180;

      addChild(searchInput);

      searchInput.addEventListener(ComponentEvent.ENTER, testEnter);

       

       

      }

      private function testEnter(e:ComponentEvent):void{

      if(searchInput.text!=null){

      beginSearch(searchInput.text);

      }