03.05.2013 Views

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - 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.

use lastChild to iterate through the child nodes of rootNode<br />

for (var aNode:XMLNode = rootNode.lastChild; aNode != null; aNode =<br />

aNode.previousSibling) {<br />

trace(aNode);<br />

}<br />

// output:<br />

// <br />

// <br />

// <br />

The following example creates a new XML packet <strong>and</strong> uses the XML.lastChild property to<br />

iterate through the child nodes of the root node:<br />

// create a new XML document<br />

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

var rootNode:XMLNode = doc.firstChild;<br />

// use lastChild to iterate through the child nodes of rootNode<br />

for (var aNode:XMLNode = rootNode.lastChild; aNode != null;<br />

aNode=aNode.previousSibling) {<br />

trace(aNode);<br />

}<br />

// output:<br />

// <br />

// <br />

// <br />

See also<br />

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

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

localName (XMLNode.localName property)<br />

public localName : String [read-only]<br />

The local name portion of the XML node's name. This is the element name without the<br />

namespace prefix. For example, the node bob@example.com has the local name "mailbox", <strong>and</strong> the prefix "contact", which comprise<br />

the full element name "contact.mailbox".<br />

You can access the namespace prefix via the prefix property of the XML node object. The<br />

nodeName property returns the full name (including the prefix <strong>and</strong> the local name).<br />

Availability: <strong>ActionScript</strong> 1.0; Flash Player 8<br />

1348 <strong>ActionScript</strong> classes

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

Saved successfully!

Ooh no, something went wrong!