Client-Side Communication ActionScript > NetConnection.isConnected

 

NetConnection.isConnected

Availability

Flash Player 6.

Flash Communication Server MX.

Usage

myConnection.isConnected

Description

Read-only property; a Boolean value indicating whether the Flash Player is connected to the server (true) or not (false) through the specified connection. Whenever a connection is made or closed, this property is set.

Example

The following example is attached to a toggle push button. When the user clicks the button, if the user is connected to the server, the connection is closed. If the user is not connected, a connection is established.

on (release) {
	if (_root.connection.isConnected == true)
		_root.connection.close();
	else
		_root.connection.connect(_root.myURI); 
}

See also

NetConnection.close, NetConnection.connect, NetConnection.onStatus