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

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 155
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 139
ADOBE FLASH MEDIA INTERACTIVE SERVER
Server-Side ActionScript Language Reference
137
XML.onData()
my_xml.onData = function(src) {}
Invoked when XML text has been completely downloaded from the server or when an error occurs in downloading
XML text from a server. This handler is invoked before the XML is parsed, and you can use it to call a custom parsing
routine instead of using the Flash XML parser. The
src parameter is a string that contains XML text downloaded
from the server, unless an error occurs during the download. In this situation, the
src parameter is undefined.
By default, the
XML.onData() event handler invokes XML.onLoad(). You can override the XML.onData() event
handler with custom behavior, but
XML.onLoad() is not called unless you call it in your XML.onData() implemen-
tation.
Availability
Flash Media Server 2
Parameters
src A string or undefined; the raw data, usually in XML format, that is sent by the server.
Example
The following example shows what the
XML.onData() event handler looks like by default:
XML.prototype.onData = function (src) {
if (src == undefined) {
this.onLoad(false);
} else {
this.parseXML(src);
this.loaded = true;
this.onLoad(true);
}
};
You can override the XML.onData() event handler to intercept the XML text without parsing it.
XML.onHTTPStatus()
myXML.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.
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 Server did not try to make the URL request.
If Flash Media Interactive Server cannot get a status code from the server, or if it cannot communicate with the
server, the default value of 0 is passed to your ActionScript code.
Availability
Flash Media Server 2
Vedere la pagina 139
1 2 ... 135 136 137 138 139 140 141 142 143 144 145 ... 154 155

Commenti su questo manuale

Nessun commento