0 Replies Latest reply on Jun 5, 2007 12:58 PM by hciguy

    Recursive XML node search

    hciguy Level 1
      Hey guys,

      I am trying to make a recursive function that is passed a block of XML and then searches it until it is out of children nodes. But it doesn't work and I don't know why....any ideas? Here are the two functions:

      private function parseMenuChildren(item:XML):Boolean{

      if(item.children().length() > 0){

      for(var i:int=0; i<item.children().length(); i++){

      if((item.children() .childIndex()+1) <= item.children().length()){

      if(item.children()
      .children().length() > 1){

      parseMenuChildren( XML(item.children() .children()) );
      }
      }

      }

      return true;
      }else{
      return false;
      }
      }