XML.sendAndLoad()
Availability
Flash Player 5; behavior changed in Flash Player 7.
Usage
my_xml.sendAndLoad(url:String, targetXMLobject:XML) : Void
Parameters
A string; the destination URL for the specified XML object. If the SWF file issuing this call
url
is running in a web browser,
Description section.
targetXMLobject
the return information from the server.
Returns
Nothing.
Description
Method; encodes the specified XML object into an XML document, sends it to the specified
URL using the
POST
targetXMLobject
used by the
XML.load()
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 is issuing this call. A superdomain is derived by
removing the left-most 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 hosting the SWF file. For more information, see "About allowing
cross-domain data loading" in Using ActionScript in Flash.
When
sendAndLoad()
XML data finishes downloading, the
loaded, and the
onLoad
completely downloaded. If the XML object previously contained any XML trees, they are
discarded.
Example
The following example includes ActionScript for a simple e-commerce storefront application.
The
XML.sendAndLoad()
password, and uses an
must be in the same domain as the SWF file; for details, see the
url
An XML object created with the XML constructor method that will receive
method, downloads the server's response, and loads it into the
specified in the parameters. The server response loads in the same manner
method.
is executed, the XML object property
loaded
event handler is invoked. The XML data is not parsed until it is
method transmits an XML element that contains the user's name and
handler to process the reply from the server.
onLoad
url
in
Using ActionScript in Flash). For
loaded
property is set to
true
parameter must
url
parameter must be in
is set to
. When the
false
if the data successfully
XML.sendAndLoad() 1051
Need help?
Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?