XML.removeNode( ) Method

ActionScript for Flash MX: The Definitive Guide, 2nd Edition
By Colin Moock
Chapter 18.  ActionScript Language Reference
XML.removeNode( ) Method Flash 5

delete a node from an XML object hierarchy
theNode.removeNode()

Description

The removeNode( ) method deletes theNode from an XML document, where theNode can be an XML or XMLnode instance. All descendants (children, grandchildren, and so on) of theNode are also deleted. The childNodes property of theNode's parent is automatically updated to reflect the new structure of the remaining object hierarchy.

Example

Here we delete the second child node; the third child node takes its place:

myDoc = new XML("<P>one</P><P>two</P><P>three</P>"); myDoc.childNodes[1].removeNode(); trace(myDoc);  // Displays: "<P>one</P><P>three</P>"

See Also

XML.appendChild( ), XML.insertBefore( )



    ActionScript for Flash MX. The Definitive Guide
    ActionScript for Flash MX: The Definitive Guide, Second Edition
    ISBN: 059600396X
    EAN: 2147483647
    Year: 2002
    Pages: 780
    Authors: Colin Moock

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net