Handling events in a component-based application

When you develop applications, be aware that using components introduces explicit onConnectAccept and onConnectReject events. You need to include code to handle these events. When you use components, you must modify the application.onConnect statement in your server-side code to include the application.onConnectAccept and application.onConnectReject event handlers. The last line (in order of execution) of your onConnect handler should be either application.acceptConnection() or application.rejectConnection(). If your application requires additional code following the explicit acceptConnection() or rejectConnection() methods, such as a message indicating that the user has been granted or denied permission to the application, you should place that code in the application.onConnectAccept or application.onConnectReject statements.

TIP

 

If you're not using media components, you cannot use application.onConnectAccept and application.onConnectReject.

Each component can have its own application.onConnect handler. By using onConnectAccept and onConnectReject, you can customize a component or create a new one to implement authentication; for example, the code in a component could query a database and decide to accept or reject a user based on the user name and password stored in the database.

For more information about application.onConnectAccept and application.onConnectReject, see the Server-Side ActionScript Language Reference.


 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/fms/2/docs/00000053.html