
Client-Side Communication ActionScript 61
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
NetConnection.onStatus
Availability
• Flash Player 6.
• Flash Communication Server MX.
Usage
myConnection.onStatus = function(infoObject) {
// Your code here
}
Parameters
infoObject A parameter defined according to the status message. For details about this
parameter, see “NetConnection information objects” on page 107.
Returns
Nothing.
Description
Event handler; invoked when a status change or error is posted for the NetConnection object. If
you want to respond to this event handler, you must create a function to process the information
object sent by the server. For more information, see the Appendix, “Client-Side Information
Objects,” on page 105.
Komentáře k této Příručce