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()
The value you pass for the
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
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
var login_str:String = "<login username=\""+username_txt.text+"\"
password=\""+password_txt.text+"\" />";
var my_xml:XML = new XML(login_str);
var myLoginReply_xml:XML = new XML();
myLoginReply_xml.ignoreWhite = true;
myLoginReply_xml.onLoad = myOnLoad;
my_xml.sendAndLoad("http://www.flash-mx.com/mm/login_xml.cfm",
myLoginReply_xml);
function myOnLoad(success:Boolean) {
if (success) {
if ((myLoginReply_xml.firstChild.nodeName == "packet") &&
(myLoginReply_xml.firstChild.attributes.success == "true")) {
gotoAndStop("loggedIn");
} else {
gotoAndStop("loginFailed");
}
} else {
gotoAndStop("connectionFailed");
}
}
See also
XML.send(), XML.load(), XML.loaded,
476
Chapter 6: ActionScript Core Classes
method, downloads the server's response, and loads it into the
specified in the parameters. The server response loads in the same manner
method.
parameter must be in exactly the same domain. For example, a
url
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
loaded
property is set to
true
XML.onLoad
is set to
. When the
false
if the data successfully
Need help?
Do you have a question about the FLEX-FLEX ACTIONSCRIPT LANGUAGE and is the answer not in the manual?