User Guide

192 Server-Side ActionScript Language Reference
Description
Method; loads an XML document from the specified URL, and replaces the contents of the
specified XML object with the downloaded XML data. The URL is relative and is called using
HTTP. The load process is asynchronous; it does not finish immediately after the
load()
method is executed.
When the
load() method is executed, the XML object property loaded is set to false.
When the XML data finishes downloading, the
loaded property is set to true, and the
onLoad event handler is invoked. The XML data is not parsed until it is completely
downloaded. If the XML object previously contained any XML trees, they are discarded.
You can define a custom function that executes when the
onLoad event handler of the XML
object is invoked.
Example
The following simple example uses the XML.load() method:
// Create a new XML object.
var flooring = new XML();
// Set the ignoreWhite property to true (default value is false).
flooring.ignoreWhite = true;
// After loading is complete, trace the XML object.
flooring.onLoad = function(success) {
trace(flooring);
};
// Load the XML into the flooring object.
flooring.load("flooring.xml");
For the contents of the flooring.xml file, and the output that this example produces, see the
example for
XML.ignoreWhite on page 187.
See also
XML.loaded, XML.onLoad
NOTE
In Flash Media Server, the output of trace() statements appears in the application log
file and Application inspector.