Navigate an XML Document in E4X
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical"> <mx:Script> private var xmlItems:XML =<order> <item id='1'> <menuName>A</menuName> <price>3.5</price> </item> <item id='2'> <menuName>B</menuName> <price>1.5</price> </item> </order> private var arr:Array; private function init():void { arr = new Array(); for each(var xml:XML in xmlItems.item) { arr.push(Number(xml.@id)); } } </mx:Script> </mx:Application>