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 youngest:XMLNode = doc.createElement("youngest");<br />

// add the rootNode as the root of the XML document tree<br />

doc.appendChild(rootNode);<br />

// add each of the child nodes as children of rootNode<br />

rootNode.appendChild(oldest);<br />

rootNode.appendChild(middle);<br />

rootNode.appendChild(youngest);<br />

// create a copy of the middle node using cloneNode()<br />

var middle2:XMLNode = middle.cloneNode(false);<br />

// insert the clone node into rootNode between the middle <strong>and</strong> youngest nodes<br />

rootNode.insertBefore(middle2, youngest);<br />

trace(rootNode);<br />

// output (with line breaks added):<br />

// <br />

// <br />

// <br />

// <br />

// <br />

// <br />

// create a copy of rootNode using cloneNode() to demonstrate a deep copy<br />

var rootClone:XMLNode = rootNode.cloneNode(true);<br />

// insert the clone, which contains all child nodes, to rootNode<br />

rootNode.appendChild(rootClone);<br />

trace(rootNode);<br />

// output (with line breaks added):<br />

// <br />

// <br />

// <br />

// <br />

// <br />

// <br />

// <br />

// <br />

// <br />

// <br />

// <br />

// <br />

firstChild (XMLNode.firstChild property)<br />

public firstChild : XMLNode [read-only]<br />

702 ActionScript classes

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

Saved successfully!

Ooh no, something went wrong!