MACROMEDIA FLASH COMMUNICATION SERVER MX-SERVER-SIDE COMMUNICATION ACTIONSCRIPT DICTIONARY Manual do Utilizador Página 22

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 80
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 21
22
The second example is server-side code you would include in your applications main.asc file:
//When using components, always load components.asc
load( "components.asc" );
application.onConnect = function(client, username){
trace("onConnect called");
gFrameworkFC.getClientGlobals(client).username = username;
if (username == "hacker") {
application.rejectConnection(client);
}
else {
application.acceptConnection(client);
}
}
//Code is in onConnectAccept and onConnectReject statements, because
components are used
application.onConnectAccept = function(client, username){
trace("Connection accepted for "+username);
client.call("doSomething",null);
}
application.onConnectReject = function(client, username){
trace("Connection rejected for "+username);
}
See also
Application.acceptConnection, Application.onConnect,
Application.onConnectReject, Application.rejectConnection
Application.onConnectReject
Availability
Flash Communication Server MX (with communication components only)
Usage
application.onConnectReject = function (clientObj [,p1, ..., pN]){
//insert code here to indicate result of a rejected connection
};
Parameters
clientObj The client connecting to the application.
p1...pN Optional parameters passed to the application.onConnectReject method. These
parameters are passed from the client-side NetConnection.connect method when a client
connects to the application.
Returns
Nothing.
Description
Event handler; invoked only when the communication components are used (that is, only when
you include a call to load the components.asc script in your server-side application script).
application.onConnectReject is invoked on the server side when NetConnection.connect is
called from the client side and a client fails to connect to an application instance.
Vista de página 21
1 2 ... 17 18 19 20 21 22 23 24 25 26 27 ... 79 80

Comentários a estes Manuais

Sem comentários