Removenode (Xmlnode.removenode Method); Tostring (Xmlnode.tostring Method) - MACROMEDIA FLASHLITE2 ACTIONSCRIPT-LANGUAGE Reference

Actionscript language reference
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
Need help?

Need help?

Do you have a question about the FLASHLITE2 ACTIONSCRIPT-LANGUAGE and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Flash lite 2

Table of Contents