outputpanelview.as
来自「精通Actionscript 3.0 书籍源代码 非常实用」· AS 代码 · 共 35 行
AS
35 行
package logger {
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 OutputPanelView implements Observer {
// The log that this object is observing.
private var log:Logger;
/**
* Constructor
*/
public function OutputPanelView (l:Logger) {
log = l;
}
/**
* Invoked when the log changes. For details, see the
* Observer interface.
*/
public function update (o:Observable, infoObj:Object):void {
// Cast infoObj to a LogMessage instance for type checking.
var logMsg:LogMessage = LogMessage(infoObj);
trace(Logger.getLevelDesc(logMsg.getLevel()) + ": " + logMsg.getMessage());
}
public function destroy ():void {
log.removeObserver(this);
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?