28
Server-Side ActionScript Language Reference
Returns
Nothing.
Description
Event handler; invoked when the server first loads the application instance. You use this
handler to initialize an application state. You can use
application.onAppStart
and
application.onAppStop
to initialize and clean up global variables in an application because
each of these events is invoked only once during the lifetime of an application instance.
Example
The following example defines an anonymous function for the
application.onAppStart
event handler that sends a
trace
message:
application.onAppStart = function () {
trace ("onAppStart called");
};
Application.onAppStop
Availability
Flash Communication Server MX 1.0.
Usage
application.onAppStop = function (
info
){}
Parameters
info
An information object that explains why the application stopped running. See
“Server-Side Information Objects” on page 229
.
Returns
The value returned by the function you define, if any, or
null
. To refuse to unload the
application, return
false
. To unload the application, return
true
or any non-
false
value.
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.