; // Event handler to initialize the MenuBar control. private function initCollections():void { menuBarCollection = new XMLListCollection(menubarXML); } // Event handler for the MenuBar control's itemClick event. private function menuHandler(evt:MenuEvent):void { // Don't open the Alert for a menu bar item that // opens a popup submenu. if (evt.item.@data != "top") { Alert.show("Label: " + evt.item.@label + "\n" + "Data: " + evt.item.@data, "Clicked menu item"); } } ]]>