03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

var cityNode:XMLNode = my_xml.firstChild.firstChild;<br />

trace("before XML.removeNode():\n"+my_xml);<br />

cityNode.removeNode();<br />

trace("");<br />

trace("after XML.removeNode():\n"+my_xml);<br />

// output (line breaks added for clarity):<br />

//<br />

// before XML.removeNode():<br />

// <br />

// San Francisco<br />

// <br />

//<br />

// after XML.removeNode():<br />

// <br />

toString (XMLNode.toString method)<br />

public toString() : String<br />

Evaluates the specified XML object, constructs a textual representation of the XML structure,<br />

including the node, children, <strong>and</strong> attributes, <strong>and</strong> returns the result as a string.<br />

For top-level XML objects (those created with the constructor), the XML.toString() method<br />

outputs the document's XML declaration (stored in the XML.xmlDecl property), followed by<br />

the document's DOCTYPE declaration (stored in the XML.docTypeDecl property), followed by<br />

the text representation of all XML nodes in the object. The XML declaration is not output if<br />

the XML.xmlDecl property is undefined. The DOCTYPE declaration is not output if the<br />

XML.docTypeDecl property is undefined.<br />

Returns<br />

String - String.<br />

Example<br />

The following code uses the toString() method to convert an XMLNode object to a String,<br />

<strong>and</strong> then uses the toUpperCase() method of the String class:<br />

var xString = "Mary"<br />

+ "Ng"<br />

var my_xml:XML = new XML(xString);<br />

var my_node:XMLNode = my_xml.childNodes[1];<br />

trace(my_node.toString().toUpperCase());<br />

// NG<<br />

See also<br />

docTypeDecl (XML.docTypeDecl property), xmlDecl (XML.xmlDecl property)<br />

XMLNode 713

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!