Previoussibling (Xmlnode.previoussibling Property) - MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE Reference

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

Advertisement

Example
The following example creates an XML packet and displays the parent node of the username
node in the Output panel:
var my_xml:XML = new XML("mortongood&evil");
// first child is the <login /> node
var rootNode:XMLNode = my_xml.firstChild;
// first child of the root is the <username /> node
var targetNode:XMLNode = rootNode.firstChild;
trace("the parent node of '"+targetNode.nodeName+"' is:
"+targetNode.parentNode.nodeName);
trace("contents of the parent node are:\n"+targetNode.parentNode);
// output (line breaks added for clarity):
the parent node of 'username' is: login
contents of the parent node are:
morton
good&evil
See also
appendChild (XMLNode.appendChild method)
,
method)
removeNode (XMLNode.removeNode method)

previousSibling (XMLNode.previousSibling property)

public previousSibling :
An XMLNode value that references the previous sibling in the parent node's child list. The
property has a value of null if the node does not have a previous sibling node. This property
cannot be used to manipulate child nodes; use the
methods to manipulate child nodes.
removeNode()
Availability: ActionScript 1.0; Flash Lite 2.0
Example
The following example is an excerpt from the example for the
shows how you can use the
child nodes:
for (var aNode:XMLNode = rootNode.lastChild; aNode != null; aNode =
aNode.previousSibling) {
trace(aNode);
}
XMLNode
[read-only]
XML.previousSibling
,
insertBefore (XMLNode.insertBefore
,
XML
,
appendChild()
insertBefore()
XML.lastChild
property to loop through an XML node's
, and
property, and
XMLNode
755

Advertisement

Table of Contents
loading

Table of Contents