MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE Reference page 749

Flash lite 2.x actionscript language reference
Hide thumbs Also See for FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE:
Table of Contents

Advertisement

doc.appendChild(rootNode);
// add each of the child nodes as children of rootNode
rootNode.appendChild(oldest);
rootNode.appendChild(middle);
rootNode.appendChild(youngest);
// use lastChild to iterate through the child nodes of rootNode
for (var aNode:XMLNode = rootNode.lastChild; aNode != null; aNode =
aNode.previousSibling) {
trace(aNode);
}
// output:
// <youngest />
// <middle />
// <oldest />
The following example creates a new XML packet and uses the
iterate through the child nodes of the root node:
// create a new XML document
var doc:XML = new XML("");
var rootNode:XMLNode = doc.firstChild;
// use lastChild to iterate through the child nodes of rootNode
for (var aNode:XMLNode = rootNode.lastChild; aNode != null;
aNode=aNode.previousSibling) {
trace(aNode);
}
// output:
// <youngest />
// <middle />
// <oldest />
See also
appendChild (XMLNode.appendChild method)
,
method)
removeNode (XMLNode.removeNode method)
XML.lastChild
,
insertBefore (XMLNode.insertBefore
,
XML
property to
XMLNode
749

Advertisement

Table of Contents
loading

Table of Contents