User Guide

202 Server-Side ActionScript Language Reference
The following example creates and parses an XML packet. The code loops through each child
node, and displays the node value using the
firstChild property and
firstChild.nodeValue.
var my_xml = new XML("<login><username>morton</username>
<password>good&amp;evil</password></login>");
trace("using firstChild:");
for (var i = 0; i<my_xml.firstChild.childNodes.length; i++) {
trace("\t"+my_xml.firstChild.childNodes[i].firstChild);
}
trace("");
trace("using firstChild.nodeValue:");
for (var i = 0; i<my_xml.firstChild.childNodes.length; i++) {
trace("\t"+my_xml.firstChild.childNodes[i].firstChild.nodeValue);
}
The following information is written to the log file:
using firstChild:
morton
good&evil
using firstChild.nodeValue:
morton
good&evil
See also
XML.nodeType
XML.onData
Availability
Flash Media Server 2.
Usage
my_xml.onData = function(src) {}
Parameters
src A string or undefined; the raw data, usually in XML format, that is sent by the server.
NOTE
In Flash Media Server, the output of trace() statements appears in the application log
file and Application inspector.
NOTE
In Flash Media Server, the output of trace() statements appears in the application log
file and Application inspector.