<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:HBox width="400" height="300">
<mx:Script>
private function buttonClick(event:Event):void
{
trace(event.target.id);
if(event.target.id == "buttonOne")
{
trace(" button one was clicked")
}
else
{
trace(" button two was clicked")
}
}
</mx:Script>
<mx:Button click="buttonClick(event)" label="Click Me One" id="buttonOne"/>
<mx:Button click="buttonClick(event)" label="Click Me Two" id="buttonTwo"/>
</mx:HBox>
</mx:Application>
|