User Guide

1066 Chapter 2: ActionScript Language Reference
if (!socket.connect(null, 2000)) {
gotoAndStop("connectionFailed");
} else {
gotoAndStop("waitForConnection");
}
See also
function, XMLSocket.connect()