
ADOBE FLASH MEDIA INTERACTIVE SERVER
Server-Side ActionScript Language Reference
16
Define a function that is executed when the event handler is invoked. If the function returns true, the application is
unloaded. If the function returns
false, the application is not unloaded. 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 Media 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
can also use the
application.onAppStop() event to notify users before shutdown.
If you use the Administration Console or the Server Administration API to unload a Flash Media Server application,
application.onAppStop() is not invoked. Therefore you cannot use application.onAppStop() to tell users
that the application is exiting.
Availability
Flash Communication Server 1
Parameters
info An Object, called an information object, with properties that explain why the application is about to stop
running. The information object has a
code property and a level property.
Returns
The value returned by the function you define, if any, or
null. To unload the application, return true or any non-
false value. To refuse to unload the application, return false.
Example
The following example flushes the
entries_so shared object when the application stops:
application.onAppStop = function (info){
trace("*** onAppStop called.");
if (info==”Application.Shutdown”){
application.entries_so.flush();
}
}
application.onConnect()
application.onConnect = function (clientObj [, p1, ..., pN]){}
Invoked when NetConnection.connect() is called from the client. This handler is passed a Client object repre-
senting the connecting client. Use the Client object to perform actions on the client in the handler. For example, use
this function to accept, reject, or redirect a client connection, perform authentication, define methods on the Client
object to be called remotely from
NetConnection.call(), and set the Client.readAccess and Client.write-
Access
properties to determine client access rights to server-side objects.
When performing authentication, all of the information required for authentication should be sent from the
NetConnection.connect() method to the onConnect() handler as parameters (p1..., pN).
If you don’t define an
onConnect() handler, connections are accepted by default.
Code property Level property Description
Application.Shutdown status The application instance is about to shut down.
Application.GC status The application instance is about to be destroyed by the server.
Kommentare zu diesen Handbüchern