
85
SERVER-SIDE ACTIONSCRIPT LANGUAGE REFERENCE FOR ADOBE MEDIA SERVER 5.0.1
Server-Side ActionScript Language Reference
Last updated 7/2/2013
LoadVars.onData()
myLoadVars.onData(src){}
Invoked when data has completely downloaded from the server or when an error occurs while data is downloading
from a server.
Availability
Flash Media Server 2
Parameters
src A string or undefined; the raw (unparsed) data from a LoadVars.load() or LoadVars.sendAndLoad()
method call.
Details
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
src parameter that is passed to the function assigned to LoadVars.onData()
can be either
undefined or a string that contains the URL-encoded name-value pairs downloaded from the server. If
the
src parameter is undefined, an error occurred while downloading the data from the server.
The default implementation of LoadVars.onData() invokes LoadVars.onLoad(). You can override this default
implementation by assigning a custom function to
LoadVars.onData(), but LoadVars.onLoad() is not called unless
you call it in your implementation of
LoadVars.onData().
Example
The following example loads a text file and traces the content when the operation is complete:
var my_lv = new LoadVars();
my_lv.onData = function(src) {
if (src == undefined) {
trace("Error loading content.");
return;
}
trace(src);
};
my_lv.load("content.txt", my_lv, "GET");
LoadVars.onHTTPStatus()
myLoadVars.onHTTPStatus(httpStatus){}
Invoked when Adobe Media Server receives an HTTP status code from the server. This handler lets you capture and
act on HTTP status codes.
Availability
Flash Media Server 2
Parameters
httpStatus A number; the HTTP status code returned by the server. For example, a value of 404 indicates that the
server has not found a match for the requested URL. HTTP status codes can be found in sections 10.4 and 10.5 of the
HTTP specification. (For more information, see the W3 website at
www.w3.org.)
Komentarze do niniejszej Instrukcji