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

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 369
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 322
Server-Side Communication ActionScript 23
Returns
Nothing.
Description
Method; rejects the connection call from a client to the server. The application.onConnect
event handler notifies a script when a new client is connecting. In the function assigned to
application.onConnect, you can either accept or reject the connection. You can also define a
function for
application.onConnect that calls an application server for authentication. In that
case, an application could call
application.rejectConnection from the application server’s
response callback to disconnect the client from the server.
Example
In the following example, the client specified by client1 is rejected and provided with the error
message contained in err.message. The message “Too many connectionsappears on the server
side.
function onConnect(client1){
// insert code here
var err = new Object();
err.message = "Too many connections";
application.rejectConnection(client1, err);
}
The following code should appear on the client side:
clientConn.onStatus = function (info){
if (info.code == "NetConnection.Connect.Rejected"){
trace(info.application.message);
// this sends the message
// "Too many connections" to the Output window
// on the client side
}
};
See also
Application.onConnect, Application.acceptConnection
Application.server
Availability
Flash Communication Server MX.
Usage
application.server
Description
Property (read-only); contains the platform and the server-version information.
Example
The following example checks the server property against a string before executing the code
inside the
if statement:
if (application.server == "Flash Communication Server-Windows/1.0"){
// insert code here
}
Przeglądanie stron 322
1 2 ... 318 319 320 321 322 323 324 325 326 327 328 ... 368 369

Komentarze do niniejszej Instrukcji

Brak uwag