flex xmllist 转为array

    private function xmlListToArray(results:XMLList):Array   
                {   
                    var array:Array=new Array();   
                    for each(var child:XML in results)   
                    {   
                        var obj:Object=new Object();   
                        //obj[child.nodeKind()]=child[child.nodeKind()];   
                        for each(var ite:XML in child.children())   
                        {   
                            obj[ite.name().toString()]=child[ite.name().toString()];   
                        }   
                        array.push(obj);                       
                   }   
                   return array;   
     }  

你可能感兴趣的:(Flex)