MACROMEDIA FLASH MEDIA SERVER 2-SERVER MANAGEMENT ACTIONSCRIPT LANGUAGE Manuel d'utilisateur Page 24

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 155
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 23
ADOBE FLASH MEDIA INTERACTIVE SERVER
Server-Side ActionScript Language Reference
21
}
The following example is server-side code that you can include in the 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);
}
}
application.onConnectAccept = function(client, username){
trace("Connection accepted for "+username);
client.call("doSomething",null);
}
application.onConnectReject = function(client, username){
trace("Connection rejected for "+username);
}
application.onDisconnect()
application.onDisconnect = function (clientObj){}
Invoked when a client disconnects from an application. Use this event handler to flush any client state information
or to notify other users that a user is leaving the application. This handler is optional.
Note: After a client has disconnected from an application, you cannot use this method to send data back to that discon-
nected client.
Availability
Flash Communication Server 1
Parameters
clientObj A Client object; a client disconnecting from the application.
Returns
Server ignores any return value.
Example
The following example uses an anonymous function and assigns it to the
application.onDisconnect() event
handler:
// This code should be placed in the global scope.
application.onDisconnect = function (client){
// Do all the client-specific disconnect logic.
// Insert code here.
trace("user disconnected");
};
Vue de la page 23
1 2 ... 19 20 21 22 23 24 25 26 27 28 29 ... 154 155

Commentaires sur ces manuels

Pas de commentaire