Flash CS3 Documentation |
|||
| ActionScript 2.0 Language Reference > ActionScript classes > XMLNode > removeNode (XMLNode.removeNode method) | |||
public removeNode() : Void
Removes the specified XML object from its parent. Also deletes all descendants of the node.
Availability: ActionScript 1.0; Flash Player 5
The following example creates an XML packet, and then deletes the specified XML object and its descendant nodes:
var xml_str:String = "<state name=\"California\"><city>San Francisco</city></state>";
var my_xml:XML = new XML(xml_str);
var cityNode:XMLNode = my_xml.firstChild.firstChild;
trace("before XML.removeNode():\n"+my_xml);
cityNode.removeNode();
trace("");
trace("after XML.removeNode():\n"+my_xml);
// output (line breaks added for clarity):
//
// before XML.removeNode():
// <state name="California">
// <city>San Francisco</city>
// </state>
//
// after XML.removeNode():
// <state name="California" />
Flash CS3
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/9.0/main/00002364.html