Debugging and Monitoring Applications > Using onStatus event handlers > Using System.onStatus

 

Using System.onStatus

In addition to the specific onStatus methods provided for the objects listed above, Flash MX also provides a "super function" called System.onStatus. If onStatus is invoked for a particular object with a level property of "Error" and there is no function assigned to respond to it, Flash processes a function assigned to System.onStatus if it exists.

The following example code sends a message to the Output window when an error message occurs for an object that hasn't been assigned an onStatus handler.

System.onStatus = function(genericError) {
	// Your script would do something more meaningful here
	trace("An error has occurred. Please try again.");
};