Set focus for TextInput : TextInput Focus « Components « Flex






Set focus for TextInput

Set focus for TextInput
         
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    creationComplete="initApp()">
    <mx:Script>
    private function initApp():void {
        application.addEventListener(KeyboardEvent.KEY_UP, keyHandler);
        my_vbox.addEventListener(KeyboardEvent.KEY_UP, keyHandler);
        my_textinput.addEventListener(KeyboardEvent.KEY_UP, keyHandler);
        my_textinput.setFocus();
    }
    private function keyHandler(event:KeyboardEvent):void {
        trace(event.target + "(" + event.currentTarget + "): " + event.keyCode + "/" + event.charCode);
    }
  </mx:Script>
    <mx:VBox id="my_vbox">
        <mx:TextInput id="my_textinput" />
    </mx:VBox>
</mx:Application>

   
    
    
    
    
    
    
    
    
  








Related examples in the same category

1.TextInput focus in and focus out eventsTextInput focus in and focus out events
2.TextInput control focusOut eventTextInput control focusOut event