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.

create another array <strong>and</strong> use the child nodes to populate it<br />

var secondArray:Array = rootNode.childNodes;<br />

trace(secondArray);<br />

// output: ,,<br />

See also<br />

nodeType (XMLNode.nodeType property), appendChild (XMLNode.appendChild<br />

method), insertBefore (XMLNode.insertBefore method), removeNode<br />

(XMLNode.removeNode method)<br />

cloneNode (XMLNode.cloneNode method)<br />

public cloneNode(deep:Boolean) : XMLNode<br />

Constructs <strong>and</strong> returns a new XML node of the same type, name, value, <strong>and</strong> attributes as the<br />

specified XML object. If deep is set to true, all child nodes are recursively cloned, resulting in<br />

an exact copy of the original object's document tree.<br />

The clone of the node that is returned is no longer associated with the tree of the cloned item.<br />

Consequently, nextSibling, parentNode, <strong>and</strong> previousSibling all have a value of null. If<br />

the deep parameter is set to false, or the my_xml node has no child nodes, firstChild <strong>and</strong><br />

lastChild are also null.<br />

Parameters<br />

deep:Boolean - A Boolean value; if set to true, the children of the specified XML object will<br />

be recursively cloned.<br />

Returns<br />

XMLNode - An XMLNode Object.<br />

Example<br />

The following example shows how to use the XML.cloneNode() method to create a copy of a<br />

node:<br />

// create a new XML document<br />

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

// create a root node<br />

var rootNode:XMLNode = doc.createElement("rootNode");<br />

// create three child nodes<br />

var oldest:XMLNode = doc.createElement("oldest");<br />

var middle:XMLNode = doc.createElement("middle");<br />

XMLNode 701

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

Saved successfully!

Ooh no, something went wrong!