174
Server-Side ActionScript Language Reference
XML.childNodes
Availability
Flash Media Server 2.
Usage
my_xml
.childNodes
Description
Property (read-only); 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
XML.appendChild()
,
XML.insertBefore()
, and
XML.removeNode()
methods to manipulate child nodes.
This property is undefined for text nodes (
nodeType ==
3).
Example
The following example shows how to use the
XML.childNodes
property to return an array of
child nodes:
// Create a new XML document.
var doc = new XML();
// Create a root node.
var rootNode = doc.createElement("rootNode");
// Create three child nodes.
var oldest = doc.createElement("oldest");
var middle = doc.createElement("middle");
var youngest = 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>
Содержание FLASH MEDIA SERVER 2
Страница 1: ...Server Side ActionScript Language Reference...
Страница 4: ...4 Contents...
Страница 228: ...228 Server Side ActionScript Language Reference...
Страница 234: ...234 Server Side Information Objects...