MACROMEDIA FLASH MEDIA SERVER 2-SERVER MANAGEMENT ACTIONSCRIPT LANGUAGE Manuale Utente Pagina 67

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 155
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 66
ADOBE FLASH MEDIA INTERACTIVE SERVER
Server-Side ActionScript Language Reference
64
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 Flash Media Interactive 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 URI. HTTP status codes can be found in sections 10.4 and 10.5
of the HTTP specification.
Details
The
onHTTPStatus() handler is invoked before onData(), which triggers calls to onLoad() with a value of
undefined if the load fails. After onHTTPStatus() is triggered, onData() is always triggered, whether or not you
override
onHTTPStatus(). To best use the onHTTPStatus() handler, you should write a function to catch the result
of the
onHTTPStatus() call; you can then use the result in your onData() and onLoad() handlers. If
onHTTPStatus() is not invoked, this indicates that Flash Media Interactive Server did not try to make the URL
request.
If Flash Media Interactive Server cannot get a status code, or if it cannot communicate with the server, the default
value of 0 is passed to your ActionScript code.
Vedere la pagina 66
1 2 ... 62 63 64 65 66 67 68 69 70 71 72 ... 154 155

Commenti su questo manuale

Nessun commento