Create a PopUpMenuButton control using an E4X XML data provider.
<?xml version="1.0"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:Script> import mx.controls.Menu private function initData():void { Menu(pb2.popUp).selectedIndex=2; } </mx:Script> <mx:XML format="e4x" id="dp2"> <root> <editItem label="A" /> <editItem label="B" /> <editItem label="C" /> <separator type="separator" /> <editItem label="D" /> </root> </mx:XML> <mx:PopUpMenuButton id="pb2" dataProvider="{dp2}" labelField="@label" showRoot="false" creationComplete="initData();" /> </mx:Application>