home *** CD-ROM | disk | FTP | other *** search
- package com.livebrush.ui
- {
- import fl.controls.Button;
- import fl.controls.TextArea;
- import flash.display.MovieClip;
- import flash.events.MouseEvent;
-
- [Embed(source="/_assets/assets.swf", symbol="symbol261")]
- public class Consol extends Panel
- {
- public static var recentConsol:Consol;
-
- public static var globalConsol:Consol;
-
- public static var messageTypes:Array = [{
- "id":"default",
- "color":0,
- "indent":0,
- "prefix":"",
- "suffix":"",
- "newline":true,
- "bold":false
- },{
- "id":"warning",
- "color":14483456,
- "indent":0,
- "prefix":"",
- "suffix":"",
- "newline":true,
- "bold":false
- },{
- "id":"app",
- "color":0,
- "indent":0,
- "prefix":"",
- "suffix":"",
- "newline":true,
- "bold":true
- },{
- "id":"file",
- "color":56576,
- "indent":2,
- "prefix":"",
- "suffix":"",
- "newline":true,
- "bold":false
- }];
-
- public var bg:MovieClip;
-
- public var clearBtn:Button;
-
- public var tf:TextArea;
-
- public var titlebar:PanelTitleBar;
-
- public function Consol()
- {
- super();
- super.setup();
- this.titlebar.showHelp = false;
- label = "Consol";
- recentConsol = this;
- this.clearBtn.addEventListener(MouseEvent.CLICK,this.clearConsole);
- this.__setProp_tf_Console_Layer82_0();
- this.__setProp_clearBtn_Console_Layer82_0();
- }
-
- public static function Trace(str:Object, addReplace:Boolean = true) : void
- {
- Consol.globalOutput(str,addReplace);
- }
-
- public static function globalOutput(str:Object, addReplace:Boolean = true) : void
- {
- if(globalConsol == null)
- {
- globalConsol = recentConsol;
- }
- globalConsol.output(str,addReplace);
- }
-
- public static function Clear() : void
- {
- Consol.globalConsol.tf.text = "";
- }
-
- public function output(str:Object, addReplace:Boolean = true) : void
- {
- try
- {
- if(addReplace)
- {
- this.tf.text += str.toString() + "\n";
- }
- else
- {
- this.tf.text = str.toString();
- }
- }
- catch(e:Error)
- {
- output("Consol: Object passed to Consol is null or undefined -> " + e.toString());
- }
- this.tf.verticalScrollPosition = this.tf.maxVerticalScrollPosition;
- recentConsol = this;
- }
-
- internal function __setProp_tf_Console_Layer82_0() : *
- {
- try
- {
- this.tf["componentInspectorSetting"] = true;
- }
- catch(e:Error)
- {
- }
- this.tf.condenseWhite = false;
- this.tf.editable = true;
- this.tf.enabled = true;
- this.tf.horizontalScrollPolicy = "auto";
- this.tf.htmlText = "";
- this.tf.maxChars = 0;
- this.tf.restrict = "";
- this.tf.text = "";
- this.tf.verticalScrollPolicy = "auto";
- this.tf.visible = true;
- this.tf.wordWrap = false;
- try
- {
- this.tf["componentInspectorSetting"] = false;
- }
- catch(e:Error)
- {
- }
- }
-
- public function clearConsole(e:MouseEvent = null) : void
- {
- Consol.Clear();
- }
-
- internal function __setProp_clearBtn_Console_Layer82_0() : *
- {
- try
- {
- this.clearBtn["componentInspectorSetting"] = true;
- }
- catch(e:Error)
- {
- }
- this.clearBtn.emphasized = false;
- this.clearBtn.enabled = true;
- this.clearBtn.label = "Clear";
- this.clearBtn.labelPlacement = "right";
- this.clearBtn.selected = false;
- this.clearBtn.toggle = false;
- this.clearBtn.visible = true;
- try
- {
- this.clearBtn["componentInspectorSetting"] = false;
- }
- catch(e:Error)
- {
- }
- }
- }
- }
-
-