User Guide
208 Server-Side ActionScript Language Reference
Description
Method; parses the XML text specified in the source parameter and populates the specified
XML object with the resulting XML tree. Any existing trees in the XML object are discarded.
Example
The following example creates and parses an XML packet:
var xml_str = "<state name=\"California\">
<city>San Francisco</city></state>"
// Defining the XML source within the XML constructor:
var my1_xml = new XML(xml_str);
trace(my1_xml.firstChild.attributes.name); // output: California
// Defining the XML source using the XML.parseXML method:
var my2_xml = new XML();
my2_xml.parseXML(xml_str);
trace(my2_xml.firstChild.attributes.name);
// output: California
XML.prefix
Availability
Flash Media Server 2.
Usage
my_xml.prefix
Description
Property (read-only); the prefix portion of the XML node name. For example, in the node
<contact:mailbox/>bob@example.com</contact:mailbox> the prefix “contact” and the local
name “mailbox”, comprise the full element name contact.mailbox.
NOTE
In Flash Media Server, the output of trace() statements appears in the application log
file and Application inspector.