XML.lastChild Property | Flash 5 |
a reference to the last descendant of a node | read-only |
The lastChild property is synonymous with childNodes[childNodes.length - 1]. It returns a reference to the last node object that descends from theNode, where theNode can be an XML or XMLnode instance. If theNode has no children, lastChild returns null.
In the following XML source fragment, the lastChild of the MESSAGE node is the CONTENT node:
<MESSAGE><USER>gray</USER><CONTENT>hi</CONTENT></MESSAGE>
// Create a new XML document myDoc = new XML('<MESSAGE><USER>gray</USER><CONTENT>hi</CONTENT></MESSAGE>'); // Sets msg to "hi" because myDoc's firstChild // is MESSAGE; MESSAGE's lastChild is CONTENT; and CONTENT's firstChild // is the text node with the value "hi" msg = myDoc.firstChild.lastChild.firstChild.nodeValue
XML.childNodes, XML.firstChild, XML.nextSibling, XML.previousSibling