# XMLSocket object

#### Availability

Flash Player 5.

#### Usage

#### Parameters

#### Description

The XMLSocket object implements client sockets that allow the computer running the Flash Player to communicate with a server computer identified by an IP address or domain name. For more information about this object, including security considerations, see .

## Method summary for the XMLSocket object

Method | Description
--- | ---
`XMLSocket.close()` | Closes an open socket connection.
`XMLSocket.connect()` | Establishes a connection to the specified server.
`XMLSocket.send()` | Sends an XML object to the server.

## Event handler summary for the XMLSocket object

Event handler | Description
--- | ---
XMLSocket.onClose() | A callback function that is invoked when an XMLSocket connection is closed.
XMLSocket.onConnect() | A callback function that is invoked by the Flash Player when a connection request initiated through the `XMLSocket.connect()` method has succeeded or failed
XMLSocket.onData() | A callback function that is invoked when an XML message has been downloaded from the server.
XMLSocket.onXML() | A callback function that is invoked when an XML object arrives from the server.

## Constructor for the XMLSocket object

#### Availability

Flash Player 5.

#### Usage

    new XMLSocket()

#### Parameters

None.

#### Returns

A reference to an object of type XMLSocket.

#### Description

Constructor; creates a new XMLSocket object. The XMLSocket object is not initially connected to any server. You must call `XMLSocket.connect()` to connect the object to a server.

#### Example

    myXMLSocket = new XMLSocket();