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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

}<br />

The following information is displayed in the Output panel:<br />

using firstChild:<br />

morton<br />

good&evil<br />

using firstChild.nodeValue:<br />

morton<br />

good&evil<br />

See also<br />

nodeType (XMLNode.nodeType property)<br />

parentNode (XMLNode.parentNode property)<br />

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

An XMLNode value that references the parent node of the specified XML object, or returns<br />

null if the node has no parent. This is a read-only property <strong>and</strong> cannot be used to manipulate<br />

child nodes; use the appendChild(), insertBefore(), <strong>and</strong> removeNode() methods to<br />

manipulate child nodes.<br />

Example<br />

The following example creates an XML packet <strong>and</strong> displays the parent node of the username<br />

node in the Output panel:<br />

var my_xml:XML = new XML("mortongood&evil");<br />

// first child is the node<br />

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

// first child of the root is the node<br />

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

trace("the parent node of '"+targetNode.nodeName+"' is:<br />

"+targetNode.parentNode.nodeName);<br />

trace("contents of the parent node are:\n"+targetNode.parentNode);<br />

// output (line breaks added for clarity):<br />

the parent node of 'username' is: login<br />

contents of the parent node are:<br />

morton<br />

good&evil<br />

XMLNode 711

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

Saved successfully!

Ooh no, something went wrong!