About onStatus event handlers

The client-side Camera, Microphone, NetConnection, NetStream, and SharedObject classes, as well as the server-side Application, NetConnection, Stream, and SharedObject classes, provide an onStatus event handler that uses an information object to provide information, status, or error messages. To respond to this event handler, you must create a function to process the information object, and you must know the format and contents of the information object returned.

By default, every information object has a code property that contains a string that describes the result of the onStatus method, and a level property that contains a string that is either "status", "warning", or "error". Some information objects have additional default properties, which provide more information about the reason onStatus was invoked.

For more information about the values that various onStatus handlers return, see the Client-Side ActionScript Language Reference for Flash Media Server 2. The following table summarizes the information objects that certain server-side calls return; the server-side call on the left invokes the client-side NetConnection.onStatus handler with the code value on the right. (This information is not included in the Client-Side ActionScript Language Reference for Flash Media Server 2.)

Server-side call

Code value for client-side NetConnection.onStatus handler

application.acceptConnection()

NetConnection.Connect.Success

application.rejectConnection()

NetConnection.Connect.Rejected

application.disconnect()

NetConnection.Connect.Closed

The following sections include additional recommendations on how to write applications to best implement this feature.


 

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

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