Simple Example.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" verticalAlign="middle"
horizontalAlign="center" backgroundGradientColors="[0x000000,0x323232]" paddingTop="0">
<!-- Handling Events - Function with addEventListener -->
<mx:Script>
private function handleClick(event:MouseEvent):void
{
mx.controls.Alert.show('clicked!');
}
</mx:Script>
<mx:Button id="b" label="click me " click=" b.addEventListener(MouseEvent.CLICK, handleClick)">
</mx:Button>
</mx:Application>
No comments:
Post a Comment