Flash Lite 2.x and 3.0 ActionScript Language Reference

onClose (XMLSocket.onClose handler)

onClose = function() {}

Invoked only when the server closes an open connection. The default implementation of this method performs no actions. To override the default implementation, you must assign a function containing custom actions.

Example

The following example executes a trace statement if the server closes an open connection:

var socket:XMLSocket = new XMLSocket();
socket.connect(null, 2000);
socket.onClose = function () {
    trace("Connection to server lost.");
}

See also

onConnect (XMLSocket.onConnect handler), Array function