
16
Description
Event handler; invoked when the application is about to be unloaded by the server. You can
define a function that executes when the event handler is invoked. If the function returns
true,
the application unloads. If the function returns false, the application doesn’t unload. If you
don’t define a function for this event handler, or if the return value is not a Boolean value, the
application is unloaded when the event is invoked.
The Flash Communication Server application passes an information object to the
application.onAppStop event. You can use server-side ActionScript to look at this information
object to decide what to do in the function you define. You could also define the
application.onAppStop event to notify users before shutdown.
If you use the Administration Console or the Administration API to unload a Flash
Communication Server application,
application.onAppStop is not invoked. Therefore you
cannot use the
application.onAppStop event, for example, to tell users that the application is
exiting.
Example
This example defines a function to perform the shutdown operations on the application. The
function is then assigned to the event handler so that it executes when the handler is invoked.
function onMyApplicationEnd(info){
// Do all the application-specific shutdown logic...
// insert code here
}
application.onAppStop = onMyApplicationEnd;
Application.onConnect
Availability
Flash Communication Server MX.
Usage
application.onConnect = function (clientObj [, p1, ..., pN]){
// insert code here to call methods that do authentication
// returning null puts client in a pending state
return null;
};
(usage 2)
application.onConnect = function (clientObj [, p1, ..., pN]){
// insert code here to call methods that do authentication
// accepts the connection
application.acceptConnection(clientObj);
}
(usage 3)
application.onConnect = function (clientObj [, p1, ..., pN])
{
// insert code here to call methods that do authentication
// accepts the connection by returning true
return true;
}
Parameters
clientObj The client connecting to the application.
Comentários a estes Manuais