ActionScript for Flash MX: The Definitive Guide, Second Edition

ActionScript for Flash MX: The Definitive Guide, 2nd EditionBy 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( )

    Категории