//ActionScript code
import mx.controls.Menu; import flash.events.MouseEvent;
private var menu12:Menu; private function init():void { menu12 = new Menu(); menu12.labelField = "@label"; menu12.dataProvider = xmlDP; menu12.showRoot = false; menu12.width = popUpButton.width; popUpButton.popUp = menu12; }
// XML Info
<menu1 label="Some introduction" />
<menu2 label="Disabled State (disabled)." enabled="false" />
<sep1 type="separator" />
<menu3 label="parent">
<menu4 label="child1" />
</menu3>
<menu5 label="parent (disabled)" enabled="false">
<menu6 label="child1" />
<menu7 label="child2" />
<menu8 label="child3" />
</menu5>
<menu9 type="separator" />
<menu10 type="separator" />
<menu11 id="leftButton" label="Left" type="radio" groupName="radioGroup" toggled="true" enabled="true" />
<menu12 id="rightButton" label="Right" type="radio" groupName="radioGroup" enabled="false" />
<menu13 id="popupButton" label="Popup" type="radio" groupName="radioGroup" enabled="false" />
</root>
// component
<mx:PopUpButton id="popUpButton"
label="Please select an item"
openAlways="true"
creationComplete="init();" />
how to add addevents to the menus in the popupButton.