Name
XML.sendAndLoad( ) Method — send XML source code to a script, and receive XML source in return
Availability
Flash 5
Synopsis
XMLdoc.sendAndLoad(URL, resultXML)
Arguments
- URL
A string specifying the location of a script or application to which
XMLdocshould be sent.
- resultXML
A reference to an
XMLdocument object that will receive the returned XML source code.
Description
The sendAndLoad( ) method serializes
XMLdoc into a string of XML source code
and sends that code to a script or application that resides at
URL. The script or application is expected
to process the XML in some way and send an XML document back as a
response. The response document is caught by Flash, parsed, converted
into an XML object hierarchy, and placed in
resultXML. Any previous contents of
resultXML are replaced by the newly loaded
XML content. See XML.send( ) for important
information about sending XML to a server.
Usage
Before accessing content imported with sendAndLoad(
), we must be sure that the load and parsing operations
are complete. To do so, we either check the value of the
resultXML’s
loaded property or we assign
resultXML an onLoad(
) event handler to respond to the load completion. See the
XML.loaded and
XML.onLoad( ) entries for details. To determine
the result of parsing the loaded data, we check the document’s
status property.
XML.sendAndLoad( ) is subject to the
domain-based security restrictions described in Table 20.8 under the global loadVariables(
) function.
Example
// Create an XML document ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access