Add event handler for application : Application Event « Container « Flex

Home
Flex
1.Chart
2.Components
3.Container
4.Data Model
5.Development
6.Effects
7.Event
8.Graphics
9.Grid
10.Style
Flex » Container » Application EventScreenshots 
Add event handler for application
Add event handler for application
            
<?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.Application creationComplete event
2.Application initialize eventApplication initialize event
3.Use Application control's initialize eventUse Application control's initialize event
4.preinitialize, initialize, creationComplete events for Applicationpreinitialize, initialize, creationComplete events for Application
5.Application complete eventApplication complete event
6.Application click eventApplication click event
w___ww__.__j___a__v_a__2___s_.__c___om | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.