Onload (Loadvars.onload Handler) - MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference

Actionscript 2.0 language reference
Table of Contents

Advertisement

See also
onHTTPStatus (XML.onHTTPStatus handler)
sendAndLoad (LoadVars.sendAndLoad method)

onLoad (LoadVars.onLoad handler)

onLoad = function(success:Boolean) {}
Invoked when a
LoadVars.load()
operation was successful,
these variables are available when this handler is invoked.
This handler is undefined by default.
This event handler is similar to
Availability: ActionScript 1.0; Flash Player 6
Parameters
- A Boolean value that indicates whether the load operation ended in
success:Boolean
success (
) or failure (
true
Example
The following example adds a TextInput instance called
, and a Button instance called
result_ta
the Login button instance, two LoadVars objects are created:
object copies the name from the
send_lv
greeting.cfm. The result from this script loads into the
response is displayed in the TextArea instance (
on Frame 1 of the Timeline:
var submitListener:Object = new Object();
submitListener.click = function(evt:Object) {
var result_lv:LoadVars = new LoadVars();
result_lv.onLoad = function(success:Boolean) {
if (success) {
result_ta.text = result_lv.welcomeMessage;
} else {
result_ta.text = "Error connecting to server.";
}
};
var send_lv:LoadVars = new LoadVars();
send_lv.name = name_ti.text;
send_lv.sendAndLoad("http://www.flash-mx.com/mm/greeting.cfm",
result_lv, "POST");
};
submit_button.addEventListener("click", submitListener);
or
LoadVars.sendAndLoad()
is populated with variables downloaded by the operation, and
my_lv
.
XML.onLoad
).
false
submit_button
name_ti
,
load (LoadVars.load method)
operation has ended. If the
, a TextArea instance called
name_ti
to the Stage. When the user clicks
send_lv
instance and sends the data to
object, and the server
result_lv
). Add the following ActionScript
result_ta
,
and
. The
result_lv
LoadVars
705

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash 8

Table of Contents