Flash Media Server |
|||
| Developing Media Applications > Debugging and Monitoring Applications > About onStatus event handlers > About overriding the onStatus handler | |||
Even if you don't need to do anything in the onStatus handler, it's a good idea to override the generic onStatus handler whenever you create an object, as shown in the following example:
// 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 traceStatus() function to your onStatus handler, but in the meantime you can at least see all of the messages related to your application.
Always check for status messages on both the client and server.
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/fms/2/docs/00000096.html