Add event handler for TextInput : TextInput « Components « Flex






Add event handler for TextInput

Add event handler 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.On value commit in a TextInput control, use alert to display the input valueOn value commit in a TextInput control, use alert to display the input value
2.Using if..else statement to do a password checkUsing if..else statement to do a password check
3.Using a switch statement to check the value of TextInputUsing a switch statement to check the value of TextInput
4.Copy values from one TextInput to another TextInput by reference idCopy values from one TextInput to another TextInput by reference id
5.Check the length of TextInput field valueCheck the length of TextInput field value
6.TextInput creationCompleteEffectTextInput creationCompleteEffect
7.Set value from TextInput to a variableSet value from TextInput to a variable
8.Use TextInput for entering informationUse TextInput for entering information
9.Get input from TextInput, Do calculation and assign result to LabelGet input from TextInput, Do calculation and assign result to Label
10.Add Spacer to PopupButton and TextInputAdd Spacer to PopupButton and TextInput
11.Creating a TextInput control with Creating a TextInput control with <mx:TextInput>
12.Use FormItem to wrap Button, TextInputUse FormItem to wrap Button, TextInput
13.Convert value in TextInput to NumberConvert value in TextInput to Number
14.Define class with style and apply to TextInputDefine class with style and apply to TextInput
15.Get text from TextInput boxGet text from TextInput box
16.Use trace() function to write the value of the text property of a TextInput control to the log fileUse trace() function to write the value of the text property of a TextInput control to the log file
17.TextInput for entering personal contact informationTextInput for entering personal contact information
18.Cast current target to a TextInput classCast current target to a TextInput class
19.Change TextInput from enabled disabled to enabledChange TextInput from enabled disabled to enabled
20.Use Form Item label to mark TextInputUse Form Item label to mark TextInput
21.Not editable TextInputNot editable TextInput
22.Use Label for mark TextInputUse Label for mark TextInput
23.Wrap TextInput in a HBox and put to FormItem
24.Format a phone number using TextInput controlFormat a phone number using TextInput control
25.TextInput enter pressed actionTextInput enter pressed action
26.Use TextInput as password fieldUse TextInput as password field
27.set a threshold value in the TextInput control.set a threshold value in the TextInput control.
28.Sum value from two TextInput in Button actionSum value from two TextInput in Button action
29.TextInput is one line text boxTextInput is one line text box
30.Filter TextInputFilter TextInput
31.Use scroll bars to see entire TextInput control by wrapping the Group container in the Scroller controlUse scroll bars to see entire TextInput control by wrapping the Group container in the Scroller control
32.Form Labels and TextInput fieldsForm Labels and TextInput fields
33.Create a TextInput control in a Form containerCreate a TextInput control in a Form container
34.Creating a TextInput controlCreating a TextInput control
35.MX TextInput control in a simple form
36.TextInput ControlTextInput Control
37.Format a phone number that a user inputs in an application by using the TextInput control:Format a phone number that a user inputs in an application by using the TextInput control:
38.Use TextInput's contentToGlobal() to convert coordinates from relative to the VGroup container to global coordinates.Use TextInput's contentToGlobal() to convert coordinates from relative to the VGroup container to global coordinates.
39.Style information for all Spark Button, TextInput, and Label componentsStyle information for all Spark Button, TextInput, and Label components
40.Convert from Celsius to Fahrenheit back and forthConvert from Celsius to Fahrenheit back and forth
41.Restricting InputRestricting Input
42.Use a backslash (\) in front of a hyphen to show that you want the hyphen literallyUse a backslash (\) in front of a hyphen to show that you want the hyphen literally