MACROMEDIA FLASH MEDIA SERVER 2-SERVER-SIDE ACTIONSCRIPT LANGUAGE Reference page 186

Server-side actionscript language reference
Table of Contents

Advertisement

XML.hasChildNodes()
Availability
Flash Media Server 2.
Usage
my_xml.hasChildNodes()
Parameters
None.
Returns
A Boolean value.
Description
Method; returns
true
Example
The following example creates a new XML packet. If the root node has child nodes, the code
loops over each child node to display the name and value of the node.
var my_xml = new XML("<login><username>hank</username>
<password>rudolph</password></login>");
if (my_xml.firstChild.hasChildNodes()) {
// Use firstChild to iterate through the child nodes of rootNode.
for (var aNode = my_xml.firstChild.firstChild; aNode != null;
aNode=aNode.nextSibling) {
if (aNode.nodeType == 1) {
trace(aNode.nodeName+":\t"+aNode.firstChild.nodeValue);
}
}
}
The following output appears:
username:hank
password:rudolph
186
Server-Side ActionScript Language Reference
if the specified XML object has child nodes;
otherwise.
false

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MEDIA SERVER 2-SERVER-SIDE ACTIONSCRIPT LANGUAGE and is the answer not in the manual?

This manual is also suitable for:

Flash media server 2

Table of Contents