MACROMEDIA FLEX-FLEX ACTIONSCRIPT LANGUAGE Reference page 451

Actionscript language reference
Table of Contents

Advertisement

Description
Read-only property; an array of the specified XML object's children. Each element in the array is
a reference to an XML object that represents a child node. This is a read-only property and
cannot be used to manipulate child nodes. Use the
and
XML.removeNode()
This property is undefined for text nodes (
Example
The following example shows how to use the
child nodes:
// create a new XML document
var doc:XML = new XML();
// create a root node
var rootNode:XMLNode = doc.createElement("rootNode");
// create three child nodes
var oldest:XMLNode = doc.createElement("oldest");
var middle:XMLNode = doc.createElement("middle");
var youngest:XMLNode = doc.createElement("youngest");
// add the rootNode as the root of the XML document tree
doc.appendChild(rootNode);
// add each of the child nodes as children of rootNode
rootNode.appendChild(oldest);
rootNode.appendChild(middle);
rootNode.appendChild(youngest);
// create an array and use rootNode to populate it
var firstArray:Array = doc.childNodes;
trace (firstArray);
// output: <rootNode><oldest /><middle /><youngest /></rootNode>
// create another array and use the child nodes to populate it
var secondArray:Array = rootNode.childNodes;
trace(secondArray);
// output: <oldest />,<middle />,<youngest />
See also
XML.nodeType
XML.cloneNode()
Availability
Flash Player 5.
Usage
my_xml.cloneNode(deep:Boolean) : XMLNode
methods to manipulate child nodes.
nodeType ==
XML.childNodes
,
XML.appendChild()
3).
property to return an array of
XML.insertBefore()
XML.cloneNode()
451
,

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLEX-FLEX ACTIONSCRIPT LANGUAGE and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flex

Table of Contents