Use this script to overwrite all onStatus function prototypes . By including this script template, you will not be required to define any onStatus events. This is an excellent tool for debugging. Listing E.5 onStatus (Catch-All) ActionScript Templatefunction onStatusTemplate(info) { infoMessage_array = info.code.split("."); trace(" ** Status Message Received for: "+infoMessage_array[0]+" **"); trace(" ** "+new Date()); trace(" ::: Level> "+info.level); trace(" ::: Code > "+info.code); // Trace extra Information properties if (info.description != undefined) { trace(" ::: Description> "+info.description); } if (info.details != undefined) { trace(" ::: Details> "+info.details); } if (info.application != undefined) { trace(" ::: Application> "+info.application); } switch (infoMessage_array[0]) { case "Application" : trace(" ::::Application Messages"); // Display Script Error Messages if (infoMessage_array[1] == "script") { trace(" ::: Script Error Details. Filename> "+info.filename+" Listings E.6 and E.7 will assign this template to the object onStatus prototypes on the Client and in SSAS. Use the ActionScript in Listing E.6 in Flash to use the onStatus template in Listing E.5 to overwrite the object prototypes. Trace actions will appear in the Flash Output window, when testing your Flash movie in Flash MX. Listing E.6 Overwrite Flash ActionScript Object's onStatus Event// Client Side Objects Camera.prototype.onStatus = onStatusTemplate; Microphone.prototype.onStatus = onStatusTemplate; NetConnection.prototype.onStatus = onStatusTemplate; NetStream.prototype.onStatus = onStatusTemplate; SharedObject.prototype.onStatus = onStatusTemplate; Use the ActionScript in Listing E.7 in SSAS to use the onStatus template in Listing E.5 to overwrite the object prototypes. Remember, the ActionScript in Listing E.5 must be added or loaded into the main.asc file for this to work. Trace actions will appear in the App Inspector or the NetConnection Debugger. Listing E.7 Overwrite Server-Side ActionScript Object's onStatus Event/* main.asc file */ // Server Side Objects Application.prototype.onStatus = onStatusTemplate; Stream.prototype.onStatus = onStatusTemplate; SharedObject.prototype.onStatus = onStatusTemplate; |