To delete all the items in the XMLList, use a for loop and iterate over the items in reverse order : Delete : XML Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » XML » Delete »

 

To delete all the items in the XMLList, use a for loop and iterate over the items in reverse order


 


package{
  import flash.display.Sprite;
  
  public class Main extends Sprite{
    public function Main(){


        var example:XML = <example>
                            <fruit color="red" name="Apple" />
                          </example>;
        
        var attributes:XMLList = example.fruit.@*;
        
        for var i:int = attributes.length(  ) 1; i >= 0; i-- ) {
            delete attributes[i];
        }
        traceexample );

    }
  }
}

        



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


Flash / Flex / ActionScript examples

 Navioo XML
» Delete