Flash Media Server |
|||
| Server-Side ActionScript Language Reference > Server-Side ActionScript Language Reference > NetConnection class > NetConnection.onStatus | |||
Flash Communication Server MX 1.0.
myNetConnection.onStatus = function(infoObject) {}
infoObject An information object. For more information about this parameter, see Server-Side Information Objects.
Nothing.
Event handler; invoked every time the status of the NetConnection object changes. For example, if the connection with the server is lost in an RTMP connection, the NetConnection.isConnected property is set to false, and NetConnection.onStatus is invoked with a status message of NetConnection.Connect.closed. For AMF connections, NetConnection.onStatus is used only to indicate a failed connection. Use this event handler to check for connectivity.
The following example defines a function for the onStatus handler that outputs messages to indicate whether the NetConnection was successful:
nc = new NetConnection();
nc.onStatus = function(info){
if (info.code == "NetConnection.Connect.Success") {
_root.gotoAndStop(2);
} else {
if (! nc.isConnected){
_root.gotoAndStop(1);
}
}
};
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/fms/2/docs/00000742.html