Specify a listener function for the Button control's click event : Button Event « Components « 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 » Components » Button EventScreenshots 
Specify a listener function for the Button control's click event
Specify a listener function for the Button control's click event
        
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
    <mx:Script>
        import mx.controls.Alert;
        private function myEventHandler(event:Event):void {
            Alert.show("An event occurred");
        }
      </mx:Script>
    <mx:Button id="b1" label="Click Me" click="myEventHandler(event)" />
</mx:Application>

   
    
    
    
    
    
    
    
  
Related examples in the same category
1.Check to see if button has certain type of eventCheck to see if button has certain type of event
2.Embed calculation logic into Button click eventEmbed calculation logic into Button click event
3.Add event listener function to Button with ActionScriptAdd event listener function to Button with ActionScript
4.Access button id that triggered the eventAccess button id that triggered the event
5.Define a handler function, register it for click event of the Button controlDefine a handler function, register it for click event of the Button control
6.Add addEventListener() inline with Button's initialize propertyAdd addEventListener() inline with Button's initialize property
7.Dispatch a Button control's click event, without clicking a ButtonDispatch a Button control's click event, without clicking a Button
8.When clicking a Button control, the Button control dispatches a click eventWhen clicking a Button control, the Button control dispatches a click event
9.RadioButton click event handlerRadioButton click event handler
10.itemClick event for group tells which button was selecteditemClick event for group tells which button was selected
11.Define an event listener for the Button controlDefine an event listener for the Button control
12.Link button click eventLink button click event
13.Set Button click event handler method with both ActionScript and MXMLSet Button click event handler method with both ActionScript and MXML
14.Change state in button click eventChange state in button click event
15.Button click property contains event listenerButton click property contains event listener
16.Accesses Button id that triggered the eventAccesses Button id that triggered the event
17.Use addEventListener() method to register different buttons to same handler functionUse addEventListener() method to register different buttons to same handler function
18.Set Button event handler with SetEventHandlerSet Button event handler with SetEventHandler
19.Call web service in Button click event handler
20.preinitialize, initialize, creationComplete events for Button controlpreinitialize, initialize, creationComplete events for Button control
21.Use button click event to update Label textUse button click event to update Label text
22.Button AddEventListener methodButton AddEventListener method
23.Button Click eventButton Click event
24.When a user selects a RadioButton control, Flex calls the event handler associated with that button's click eventWhen a user selects a RadioButton control, Flex calls the event handler associated with that button's click event
25.To set functionality such as a single event handler on the group, use the tagTo set functionality such as a single event handler on the group, use the <s:RadioButtonGroup> tag
26.itemClick event listener for the group can take a different action depending on which button was selecteditemClick event listener for the group can take a different action depending on which button was selected
27.Use the pause() and play() methods in event listener for two Button controls to pause or play an FLV file
28.Handle a Button's Click EventHandle a Button's Click Event
29.Delete button controls by pressing the mouse button and hold Shift keyDelete button controls by pressing the mouse button and hold Shift key
30.Specify listener function in the click attribute of the Specify listener function in the click attribute of the <mx:Button>
31.Define a function that logs the various stages of the Button control's startup life cycleDefine a function that logs the various stages of the Button control's startup life cycle
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.