XML.onLoad()
767
XML.onLoad()
Availability
Flash Player 5.
Usage
my_xml
.onLoad = function (
success
) {
//your statements here
}
Parameters
success
A Boolean value indicating whether the XML object was successfully loaded with a
XML.load()
or
XML.sendAndLoad()
operation.
Returns
Nothing.
Description
Event handler; invoked by Flash Player when an XML document is received from the server. If the
XML document is received successfully, the
success
parameter is
true
. If the document was not
received, or if an error occurred in receiving the response from the server, the
success
parameter
is
false
. The default implementation of this method is not active. To override the default
implementation, you must assign a function containing your own actions.
Example
The following example creates a simple SWF file for a simple e-commerce storefront application.
The
sendAndLoad()
method transmits an XML element containing the user’s name and
password, and installs an
onLoad
handler to handle the reply from the server.
function myOnLoad(success) {
if (success) {
if (e.firstChild.nodeName == "LOGINREPLY_xml" &&
e.firstChild.attributes.status == "OK") {
gotoAndPlay("loggedIn")
} else {
gotoAndStop("loginFailed")
}
} else {
gotoAndStop("connectionFailed")
}
}
var myLoginReply_xml = new XML();
myLoginReply_xml.onLoad = myOnLoad;
my_xml.sendAndLoad("http://www.samplestore.com/login.cgi",
myLoginReply_xml);
See also
function
,
XML.load()
,
XML.sendAndLoad()
Содержание FLASH MX 2004 - ACTIONSCRIPT
Страница 1: ...ActionScript Reference Guide...
Страница 8: ...8 Contents...
Страница 12: ......
Страница 24: ...24 Chapter 1 What s New in Flash MX 2004 ActionScript...
Страница 54: ...54 Chapter 2 ActionScript Basics...
Страница 80: ...80 Chapter 3 Writing and Debugging Scripts...
Страница 82: ......
Страница 110: ...110 Chapter 5 Creating Interaction with ActionScript...
Страница 112: ......
Страница 120: ...120 Chapter 6 Using the Built In Classes...
Страница 176: ......
Страница 192: ...192 Chapter 10 Working with External Data...
Страница 202: ...202 Chapter 11 Working with External Media...
Страница 204: ......
Страница 782: ...782 Chapter 12 ActionScript Dictionary...
Страница 793: ...Other keys 793 221 222 Key Key code...
Страница 794: ...794 Appendix C Keyboard Keys and Key Code Values...
Страница 798: ...798 Appendix D Writing Scripts for Earlier Versions of Flash Player...
Страница 806: ...806 Appendix E Object Oriented Programming with ActionScript 1...
Страница 816: ...816 Index...