User Guide

222 Server-Side ActionScript Language Reference
Example
The following example uses XMLSocket.connect() to connect to the local host:
var socket = new XMLSocket()
socket.onConnect = function (success) {
if (success) {
trace ("Connection succeeded!")
} else {
trace ("Connection failed!")
}
}
if (!socket.connect(null, 2000)) {
trace ("Connection failed!")
}
See also
XMLSocket.onConnect
XMLSocket.onClose
Availability
Flash Media Server 2.
Usage
myXMLSocket.onClose = function() {}
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.
NOTE
In Flash Media Server, the output of trace() statements appears in the application log
file and Application inspector.