For more information about the values that various
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
(This information is not included in the Client-Side ActionScript Language Reference for Flash
Media Server 2.)
Server-side call
application.acceptConnection()
application.rejectConnection()
application.disconnect()
The following sections include additional recommendations on how to write applications to
best implement this feature.
Where to use onStatus handlers in a script
Because of network and thread timing issues, it is best to place an
method in a script. Otherwise, the connection might complete before the script
connect
executes the
onStatus
method, and notifications are lost if the
connect
About overriding the onStatus handler
Even if you don't need to do anything in the
generic
handler whenever you create an object, as shown in the following example:
onStatus
// Create function to trace all the status info.
function traceStatus(info) {
trace("Level: " + info.level + " Code: " + info.code);
}
// Assign this function to onStatus handlers when you create objects.
var my_nc:NetConnection = new NetConnection();
my_nc.onStatus = traceStatus;
var my_ns:NetStream = new NetStream(my_nc);
my_ns.onStatus = traceStatus;
As you develop your application and determine that you need to actually override the handler
for a specific purpose, you can modify the code that assigns the
your
handler, but in the meantime you can at least see all of the messages related to
onStatus
your application.
Always check for status messages on both the client and server.
NetConnection.onStatus
Code value for client-side
NetConnection.onStatus handler
NetConnection.Connect.Success
NetConnection.Connect.Rejected
NetConnection.Connect.Closed
handler initialization. Also, all security checks are made within the
handlers return, see the Client-
onStatus
handler with the code value on the right.
handler is not yet set up.
onStatus
handler, it's a good idea to override the
onStatus
traceStatus()
About onStatus event handlers
handler before a
onStatus
function to
77
Need help?
Do you have a question about the FLASH MEDIA SERVER 2-DEVELOPING MEDIA and is the answer not in the manual?