MACROMEDIA FLASH COMMUNICATION SERVER MX-SERVER-SIDE COMMUNICATION ACTIONSCRIPT DICTIONARY Dokumentacja Strona 248

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 369
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 247
Client-Side Communication ActionScript 57
Description
Method; closes the connection with the server and invokes NetConnection.onStatus with a
code property of "NetConnection.Connect.Close". For more information, see
NetConnection.onStatus.
This method disconnects all NetStream objects running over this connection; any queued data
that has not been sent is discarded. (To terminate server streams without closing the connection,
use
NetStream.close.) If you want to reconnect, you must recreate the NetStream object (see
“Constructor for the NetStream object” on page 64).
This method also disconnects all remote shared objects running over this connection.
However, you dont need to recreate the shared object to reconnect. Instead, you can just call
SharedObject.connect to re-establish the connection to the shared object. Also, any data in the
shared object that was queued when you issued
NetConnection.close will be sent after you
reestablish a connection to the shared object.
Example
The following disconnect() function stops the published stream, then calls
NetConnection.close to delete the source connection. With no source stream to play, the
destination stream automatically ends and is deleted.
function disconnect() {
// Stops publishing the stream.
srcStream.close();
// Deletes the source stream connection.
connection.close();
}
See also
NetConnection.connect, NetConnection.onStatus, NetStream.close,
SharedObject.connect
NetConnection.connect
Availability
Flash Player 6.
Flash Communication Server MX.
Usage
myConnection.connect(targetURI, [, p1 ... pN])
Parameters
targetURI The Uniform Resource Identifier (URI) of the application on the Flash
Communication Server that should run when the connection is made. To specify
targetURI, use
one of the following formats (items in brackets are optional):
rtmp:[port]/appName[/instanceName] (acceptable if the movie and the Flash
Communication Server are on the same machine)
rtmp://host[:port]/appName[/instanceName]
Przeglądanie stron 247
1 2 ... 243 244 245 246 247 248 249 250 251 252 253 ... 368 369

Komentarze do niniejszej Instrukcji

Brak uwag