![MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference Download Page 1309](http://html.mh-extra.com/html/macromedia/flash-8-actionscript-2-0-language/flash-8-actionscript-2-0-language_reference_6875371309.webp)
XML 1309
Parameters
url
:String
- A string; the destination URL for the specified XML object. If the SWF file
issuing this call is running in a web browser,
url
must be in the same domain as the SWF file;
for details, see the Description section.
resultXML
:XML
- A target XML object created with the XML constructor method that will
receive the return information from the server.
Example
The following example includes ActionScript for a simple e-commerce storefront application.
The
XML.sendAndLoad()
method transmits an XML element that contains the user's name
and password, and uses an
onLoad
handler to process the reply from the server.
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
send (XML.send method)
,
load (XML.load method)
,
loaded (XML.loaded property)
,
onLoad (XML.onLoad handler)
Summary of Contents for FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Page 1: ...ActionScript 2 0 Language Reference ...
Page 1352: ...1352 ActionScript classes ...