MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference page 1309

Actionscript 2.0 language reference
Table of Contents

Advertisement

Parameters
- A string; the destination URL for the specified XML object. If the SWF file
url:String
issuing this call is running in a web browser,
for details, see the Description section.
- A target XML object created with the XML constructor method that will
resultXML:XML
receive the return information from the server.
Example
The following example includes ActionScript for a simple e-commerce storefront application.
The
XML.sendAndLoad()
and 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
send (XML.send method)
onLoad (XML.onLoad handler)
url
method transmits an XML element that contains the user's name
handler to process the reply from the server.
onLoad
,
load (XML.load method)
must be in the same domain as the SWF file;
,
loaded (XML.loaded property)
,
XML
1309

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash 8

Table of Contents