Description
Event handler; invoked when Flash Media Server receives an HTTP status code from the
server. This handler lets you capture and act on HTTP status codes.
The
handler is invoked before
onHTTPStatus
value of
if the load fails. After
undefined
triggered, whether or not you override
handler, you should write a function to catch the result of the
then use the result in your
indicates that the FMS did not try to make the URL request.
If Flash Media 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.
Example
The following example shows how to use
example collects HTTP status codes and assigns their value and type to an instance of the
XML object. (Notice that this example creates the instance members
this.httpStatusType
trace information about the HTTP response that can be useful in debugging.
var myXml = new XML();
myXml.onHTTPStatus = function(httpStatus) {
this.httpStatus = httpStatus;
if(httpStatus < 100) {
this.httpStatusType = "flashError";
}
else if(httpStatus < 200) {
this.httpStatusType = "informational";
}
else if(httpStatus < 300) {
this.httpStatusType = "successful";
}
else if(httpStatus < 400) {
this.httpStatusType = "redirection";
}
else if(httpStatus < 500) {
this.httpStatusType = "clientError";
}
else if(httpStatus < 600) {
this.httpStatusType = "serverError";
}
}
myXml.onData = function(src) {
trace(">> " + this.httpStatusType + ": " + this.httpStatus);
204
Server-Side ActionScript Language Reference
onHTTPStatus
onHTTPStatus
and
onData
onLoad
onHTTPStatus
at runtime.) The
onData
, which triggers calls to
onData
is triggered,
. To best use the
onHTTPStatus
handlers. If
onHTTPStatus
to help with debugging. The
handler uses these instance members to
with a
onLoad
is always
onData
onHTTPStatus
call; you can
is not invoked, this
and
this.httpStatus
Need help?
Do you have a question about the FLASH MEDIA SERVER 2-SERVER-SIDE ACTIONSCRIPT LANGUAGE and is the answer not in the manual?