EasyManua.ls Logo

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

MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE
780 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
756 ActionScript classes
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.

Table of Contents

Related product manuals