package { //import util.Observer; //import util.Observable; /** * An observer of the Logger class. When a movie is played in * the Flash authoring tool's Test Movie mode, this class displays * log messages in the Output panel. */ public class actionscript_lib_logger_OutputPanelView implements actionscript_lib_util_Observer { // The log that this object is observing. private var log:actionscript_lib_logger_Logger; /** * Constructor */ public function actionscript_lib_logger_OutputPanelView (l:actionscript_lib_logger_Logger) { log = l; } /** * Invoked when the log changes. For details, see the * Observer interface. */ public function update (o:actionscript_lib_util_Observable, infoObj:Object):void { // Cast infoObj to a LogMessage instance for type checking. var logMsg:actionscript_lib_logger_LogMessage = actionscript_lib_logger_LogMessage(infoObj); trace(actionscript_lib_logger_Logger.getLevelDesc(logMsg.getLevel()) + ": " + logMsg.getMessage()); } public function destroy ():void { log.removeObserver(this); } } }