When
sendAndLoad()
the XML data finishes downloading, the
successfully loads and the
it is 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()
and password and uses an
var login_str = "<login username=\""+username_txt.text+"\"
password=\""+password_txt.text+"\" />";
var my_xml = new XML(login_str);
var myLoginReply_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) {
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,
is executed, the XML object property
loaded
event handler is invoked. The XML data is not parsed until
onLoad
method transmits an XML element that contains the user's name
handler to process the reply from the server.
onLoad
loaded
property is set to
XML.onLoad
is set to
. When
false
if the data
true
XML class
213
Need help?
Do you have a question about the FLASH MEDIA SERVER 2-SERVER-SIDE ACTIONSCRIPT LANGUAGE and is the answer not in the manual?