[Flex] 递归 删除XML 节点

一定要用索引,而且删除的对象要是XMLList里面的元素,不然会报错,或者不能删除!

   1: private function delNoHelpNode(xmllist1:XMLList):void{
   2:    for each(var item:XML in xmllist1){
   3:      if(item.@checked == "0"){
   4:         delete xmllist1[item.childIndex()];
   5:        }else if(item.@checked == "1"){
   6:           if(item.hasComplexContent())
   7:                arguments.callee(item.children());
   8:             }                             
   9:         }
  10:  }

你可能感兴趣的:(Flex)