Xml.load() - MACROMEDIA FLASH MX 2004-ACTIONSCRIPT LANGUAGE Reference

Actionscript language reference
Table of Contents

Advertisement

XML.load()

Availability
Flash Player 5; behavior changed in Flash Player 7.
Usage
my_xml.load(url:String) : Void
Parameters
A string that represents the URL where the XML document to be loaded is located. If the
url
SWF file that issues this call is running in a web browser,
SWF file; for details, see the Description section.
Returns
Nothing.
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
is executed.
In SWF files running in a version of the player earlier than Flash Player 7, the
be in the same superdomain as the SWF file that issues this call. A superdomain is derived by
removing the leftmost component of a file's URL. For example, a SWF file at
www.someDomain.com can load data from sources at store.someDomain.com, because both files
are in the same superdomain of someDomain.com.
In SWF files of any version running in Flash Player 7 or later, the
exactly the same domain (see "Flash Player security features"
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 "About
allowing cross-domain data loading" in Using ActionScript in Flash.
When the
load()
the XML data finishes downloading, the
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
object is invoked.
Example
The following simple example uses the
// create a new XML object
var flooring:XML = new XML();
// set the ignoreWhite property to true (default value is false)
1034
Chapter 2: ActionScript Language Reference
method is executed, the XML object property
XML.load()
must be in the same domain as the
url
in
property is set to
loaded
onLoad
method:
load()
parameter must
url
parameter must be in
url
Using ActionScript in Flash). For
is set to
loaded
false
, and the
true
onLoad
event handler of the XML
method
. When
event

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash mx

Table of Contents