Click event example (MXML) : Click Event « Event « Flex






Click event example (MXML)

Click event example (MXML)
      
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    layout="absolute">
    <mx:Button label="Click button!" click="clickFunction(event)" />
    <mx:Script>
        
        import mx.controls.Alert;
        public function clickFunction(event:Event):void
        {
            var message:String = "you clicked me! ";
            message += event.target.label;
            Alert.show(message,"Event Test");
        }
      
    </mx:Script>
</mx:Application>

   
    
    
    
    
    
  








Related examples in the same category

1.Listen to a Button ClickListen to a Button Click
2.Nested inner function is called when the button is clickedNested inner function is called when the button is clicked
3.button clickbutton click
4.Click event attribute can take ActionScript code as its valueClick event attribute can take ActionScript code as its value
5.ActionScript event handling logic inside the MXML tag's click eventActionScript event handling logic inside the MXML tag's click event
6.Intercept a click eventIntercept a click event
7.Double click eventDouble click event
8.Mark click event as its own tagMark click event as its own tag
9.The click event attribute can take ActionScript code directly as its valueThe click event attribute can take ActionScript code directly as its value
10.Use Event object to get a reference to the clicked ColumnSeries.Use Event object to get a reference to the clicked ColumnSeries.
11.Define custom behavior for the click event of the LinkElement object.Define custom behavior for the click event of the LinkElement object.