Flash Media Server |
|||
| Server-Side ActionScript Language Reference > Server-Side ActionScript Language Reference > Application class | |||
Flash Communication Server 1.
The Application class contains information about a Flash Media Server application instance that lasts until the application instance is unloaded. A Flash Media Server application is a collection of stream objects, shared objects, and clients (connected users). Each application has a unique name, and you can use a naming scheme to create multiple instances of an application. For more information about the naming scheme, see Using naming conventions.
Every instance of a Flash Media Server application has an application object, which is a single instance of the Application class. You don't need to use a constructor function to create the application object; it is created automatically when an application is instantiated by the server. Use the following syntax to call the methods, properties, and event handlers of the Application class:
application.methodPropertyOrHandler
Use the application object to accept and reject client connection attempts, register and unregister classes and proxies, and create functions that are invoked when an application starts or stops or when a client connects or disconnects.
For more information about the life cycle of an application, see "Application flow" in Developing Media Applications.
Besides the built-in properties of the Application class, you can create other properties of any legal ActionScript type, including references to other ActionScript objects. For example, the following code creates a new property of type Array and a new property of type Number:
application.myarray = new Array(); application.num_requests = 1;
|
Method |
Description |
|---|---|
|
Accepts a connection to an application from a client. |
|
|
Broadcasts a message to all connected clients. |
|
|
Clears all shared objects associated with the current instance. |
|
|
Clears all stream objects associated with the current instance. |
|
|
Disconnects a client from the server. |
|
|
Invokes the garbage collector to reclaim any unused resources for this application instance. |
|
|
Returns network statistics for the application instance. |
|
|
Registers or unregisters a constructor that is called during object deserialization. |
|
|
Registers a NetConnection or Client object to fulfill a method request. |
|
|
Rejects a connection to an application. |
|
|
Unloads the application instance. |
|
Property |
Description |
|---|---|
|
A Boolean value that lets administrators use the |
|
|
Read-only; an object containing a list of all clients currently connected to the application. |
|
|
Lets you access properties of the |
|
|
Read-only; the host name of the server for default virtual hosts, and virtual host name for non-default virtual hosts. |
|
|
Read-only; the name of an application instance. |
|
|
Read-only; the platform and version of the server. |
|
Event handler |
Description |
|---|---|
|
Invoked when the application is loaded by the server. |
|
|
Invoked when the application is unloaded by the server. |
|
|
Invoked when a client connects to the application. |
|
|
Invoked when a client successfully connects to the application; for use with media components only. |
|
|
Invoked when a client fails to connect to the application; for use with communication components only. |
|
|
Invoked when a client disconnects from the application. |
|
|
Invoked when a script generates an error. |
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/fms/2/docs/00000640.html