Ondata (Loadvars.ondata Handler) - MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE Reference

Flash lite 2.x actionscript language reference
Hide thumbs Also See for FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE:
Table of Contents

Advertisement

onData (LoadVars.onData handler)

onData = function(src:String) {}
Invoked when data has completely downloaded from the server or when an error occurs while
data is downloading from a server. This handler is invoked before the data is parsed and can
be used to call a custom parsing routine instead of the one built in to Flash Player. The value
of the
parameter passed to the function assigned to
src
or a string that contains the URL-encoded name-value pairs downloaded from the
undefined
server. If the
parameter is
src
the server.
The default implementation of
override this default implementation by assigning a custom function to
but
LoadVars.onLoad
.
LoadVars.onData
Availability: ActionScript 1.0; Flash Lite 2.0
Parameters
- A string or
src:String
LoadVars.sendAndLoad()
Example
The following example loads a text file and displays content in a TextArea instance called
when the operation completes. If an error occurs, then information displays in
content_ta
the Output panel.
var my_lv:LoadVars = new LoadVars();
my_lv.onData = function(src:String) {
if (src == undefined) {
trace("Error loading content.");
return;
}
content_ta.text = src;
};
my_lv.load("content.txt", my_lv, "GET");
See also
onLoad (LoadVars.onLoad handler)
(LoadVars.load method)
400
ActionScript classes
, an error occurred while downloading the data from
undefined
LoadVars.onData
is not called unless you call it in your implementation of
; the raw (unparsed) data from a
undefined
method call.
,
onLoad (LoadVars.onLoad handler)
,
sendAndLoad (LoadVars.sendAndLoad method)
LoadVars.onData
invokes
LoadVars.onLoad
LoadVars.onData
LoadVars.load()
can be either
. You can
,
or
,
load

Advertisement

Table of Contents
loading

Table of Contents