Removenode (Xmlnode.removenode Method); Tostring (Xmlnode.tostring Method) - MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE Reference

Flash lite 2.x actionscript language reference
Hide thumbs Also See for FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE:
Table of Contents

Advertisement

See also
,
lastChild (XMLNode.lastChild property)
appendChild (XMLNode.appendChild
,
,
method)
insertBefore (XMLNode.insertBefore method)
removeNode
,
(XMLNode.removeNode method)
XML

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 Lite 2.0
Example
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" />

toString (XMLNode.toString method)

public toString() : String
Evaluates the specified XML object, constructs a textual representation of the XML structure,
including the node, children, and attributes, and returns the result as a string.
756
ActionScript classes

Advertisement

Table of Contents
loading

Table of Contents