Ah ---

Ok, I didn't know how to interpret your earlier statement about not
being able to use a variable containing a reference... but this
fragment makes it clear that I can use delete -- for instance, to
delete a non-root node, I can say:

  delete node.parent().children()[ node.childIndex() ];


So thanks again.... I'd be grateful for any comments on the general
problem of deleting a subtree from a displayed Tree I outlined in the
response to your first reply.

-- Shaun

--- In [email protected], "Tracy Spratt" <[EMAIL PROTECTED]> wrote:
>
> I seem to recall trying to use setChildren to delete all of the child
> nodes of a node, but never made it work.  Now, when I need to do that I
> loop over the children.
> 
>  
> 
>   /**  */
> 
>   private function deleteChildren(xmlNode:XML):void
> 
>   {
> 
>     var xlChildren:XMLList = xmlNode.children();
> 
>     for (var i:int=xlChildren.length()-1;i>=0;i--)
> 
>     {
> 
>         delete xlChildren[i];                                 //so
> remove all the children
> 
>     }   
> 
>   }//deleteChildren
> 
>  
> 
> Tracy
> 


Reply via email to