User Guide
464 Chapter 6: ActionScript Core Classes
The value you pass for the url parameter must be in exactly the same domain. For example, a
SWF file at www.someDomain.com can load data only from sources that are also at
www.someDomain.com. If you want to load data from a different domain, you can place a cross-
domain policy file on the server that is hosting the SWF file. For more information, see “Applying
Flex Security” in Developing Flex Applications.
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:XML = 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.
See also
XML.loaded, XML.onLoad
XML.loaded
Availability
Flash Player 5.
Usage
my_xml.loaded:Boolean
Description
Read-only property; a Boolean value that is true if the document-loading process initiated by the
XML.load() call has completed successfully; otherwise, it is false.