Create EventHandlers for Menu-Based Controls
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical"> <mx:MenuBar labelField="@label" itemClick="handleMenuClick(event)"> <mx:XMLList> <menuitem label="File"> <menuitem label="New"/> <menuitem label="Close" enabled="false"/> </menuitem> <menuitem label="Edit"/> <menuitem label="View"> <menuitem label="100%" type="radio" groupName="one" selected="true"/> <menuitem label="150%" type="radio" groupName="one"/> </menuitem> </mx:XMLList> </mx:MenuBar> <mx:Label id="myLabel"/> <mx:Script> import mx.events.MenuEvent; private function handleMenuClick(evt:MenuEvent):void { this.myLabel.text = evt.item.@label + " was selected"; } </mx:Script> </mx:Application>