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!!
import fl.events.ComponentEvent;
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);
}