Register a single listener function, submitForm(), with two different buttons
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
private function submitForm(e:Event):void {
trace(e.currentTarget.id);
}
</mx:Script>
<mx:Button id="b1" label="Click Me" click="submitForm(event)" />
<mx:Button id="b2" label="Click Me" click="submitForm(event)" />
</mx:Application>
Related examples in the same category