Access keys

Console

Kind of class: class
Inherits from: none
Author: Jeremy Brown, Arthur Clemens
Classpath: org.asapframework.util.debug.Console
File last modified: Thursday, 12 October 2006, 11:11:41
Console creates a debugging window on the stage that can be invoked with a configurable string.
Close the window by double-clicking the bar.
Usage:
The console is enabled by default. If you don't want to use the console, add this class to the exclude xml.
You can set a character or word to activate the console. To set the activation string, use:
Console.sActivationString = "trace";
The default activation string is "debug".
Hide the console by clicking on the top right button.
There are 5 log levels: DEBUG, INFO, WARN, ERROR and FATAL. Default is DEBUG_LEVEL. To set the log level (and to ignore messages of lower rank), use:
Console.logLevel = Console.DEBUG_LEVEL;
Example usage:
Console.INFO("Version: Mon 10 May 2004");
Console.INFO("Environment: ", Environment.getEnvironment());
Version history:
2 May 2005: Fixed bugs to enable for Flash 7; added a close button; when activationString is "", press space bar to make visible again.
16 Jan 2005: Made the console enabled by default.
28 Sep 2004: Optimized KeyListener.
17 Sep 2004: Added strings "DEBUG", "INFO" etc to messages. Added double-click to hide window.
To do:
NICE:
Add a scrollbar
Add a clear button
Add error level buttons in the bar
Make the top bar visually more bar like, with a grip

Class properties

activationString

static activationString:String
(write)
The text string to make the Console appear on screen.

alpha

static alpha:Number
(write)
Alpha of the background.

DEBUG_LEVEL

static DEBUG_LEVEL:Object = {level:0, string:"Debug", color:"#0000CC"}
(read,write)
Typecode for debugging messages.

DOUBLE_CLICK_DELAY

static DOUBLE_CLICK_DELAY:Number = 250
(read,write)

enabled

static enabled:Boolean
(write)

ERROR_LEVEL

static ERROR_LEVEL:Object = {level:3, string:"Error", color:"#FF0000"}
(read,write)
Typecode for error messages.

FATAL_LEVEL

static FATAL_LEVEL:Object = {level:4, string:"Fatal", color:"#FF0000"}
(read,write)
Typecode for fatal error messages.

INFO_LEVEL

static INFO_LEVEL:Object = {level:1, string:"Info", color:"#550088"}
(read,write)
Typecode for informational messages.

logLevel

static logLevel:Number
(write)

scroll

static scroll
(write)

state

static state:String
(read)

WARN_LEVEL

static WARN_LEVEL:Object = {level:2, string:"Warn", color:"#AA0044"}
(read,write)
Typecode for warning messages.

Class methods

closeConsole

static function closeConsole (
) : Void

DEBUG

static function DEBUG (
objValue:Object) : Void

ERROR

static function ERROR (
objValue:Object) : Void

FATAL

static function FATAL (
objValue:Object) : Void

INFO

static function INFO (
objValue:Object) : Void

minimizeConsole

static function minimizeConsole (
) : Void

openConsole

static function openConsole (
) : Void

placeConsole

static function placeConsole (
) : Void

WARN

static function WARN (
objValue:Object) : Void