User Guide

1064 Chapter 2: ActionScript Language Reference
XMLSocket.onClose
Availability
Flash Player 5.
Usage
myXMLSocket.onClose = function() {
// your statements here
}
Parameters
None.
Returns
Nothing.
Description
Event handler; invoked only when an open connection is closed by the server. 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 an open connection is closed by the server:
var socket:XMLSocket = new XMLSocket();
socket.connect(null, 2000);
socket.onClose = function () {
trace("Connection to server lost.");
}
See also
function, XMLSocket.onConnect