MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH Manual page 657

Learning actionscript 2.0 in flash
Table of Contents

Advertisement

loginXML.sendAndLoad("http://www.flash-mx.com/mm/main.cfm",
loginReplyXML);
};
You can test this code by using a user name of
first section of the script generates the following XML when the user clicks the login button:
<login username="JeanSmith" password="VerySecret" />
The server receives the XML, generates an XML response, and sends it back to the SWF file.
If the password is accepted, the server responds with the following:
<LOGINREPLY STATUS="OK" SESSION="4D968511" />
This XML includes a
ID, which is used in all communications between the client and server for the rest of the
session. If the password is rejected, the server responds with the following message:
<LOGINREPLY STATUS="FAILURE" />
The
XML node must load into a blank XML object in the SWF file. The
loginreply
following statement creates the XML object
// Construct an XML object to hold the server's reply
var loginReplyXML:XML = new XML();
loginReplyXML.onLoad = function(success:Boolean) {
The second statement in this ActionScript defines an anonymous (inline) function, which is
called when the
onLoad
The login button (
login_btn
to the server and to load an XML response back into the SWF file. You can use the
method to do this, as shown in the following example:
sendAndLoad()
loginXML.sendAndLoad("http://www.flash-mx.com.com/mm/main.cfm",
loginReplyXML);
attribute that contains a unique, randomly generated session
session
event triggers.
instance) is used to send the user name and password as XML
and the password
JeanSmith
to receive the XML node:
loginreplyXML
. The
VerySecret
About XML
657

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash 8

Table of Contents