The net.eidiot.etracer package contains a variety of package-level functions to initialize the ETracer and output debug infomation. Only one of the initETracer() and initLcETracer() function can be used to initialize the ETracer. Just delete this function if want to stop all the output.
Public Functions
 FunctionDefined by
  
eerror(e:Error):void
Output error infomation.
net.eidiot.etracer
  
einfo(value:Object, title:String = "", depth:int = 0, ... params):void
Output debug information.
net.eidiot.etracer
  
elog(value:Object, ... rest):void
Output log messages.
net.eidiot.etracer
  
etrace(... arguments):void
Output debug information like the trace() method.
net.eidiot.etracer
  
ewarn(e:Error):void
Outout warn infomation.
net.eidiot.etracer
  
initETracer(target:DisplayObjectContainer, w:Number = 640, h:Number = 480, initX:Number = -1, initY:Number = -1, autoHide:Boolean = true):void
Initialize ETracer which show messages in the same swf.
net.eidiot.etracer
  
Initialize ETracer which send messages by LocalConnection and show messages in another swf.
net.eidiot.etracer
Function detail
eerror()function
public function eerror(e:Error):void

Output error infomation.

Parameters
e:Error — Error infomation as an Error object.

Example
The following code output an catched error:
  try
  {
   loader.unload();
  }
  catch (e:Error)
  {
   eerror(e);
  }
  
einfo()function 
public function einfo(value:Object, title:String = "", depth:int = 0, ... params):void

Output debug information.

Parameters
value:Object — Debug infomation to output.
 
title:String (default = "") — Title of the infomation.
 
depth:int (default = 0) — Depth to deep loop. Set depth to 1 if want to get "c" from the object {a:"a", b:{c:"c"}}.
 
... params — params Property names of the value object to output like "name", "alpha".

Example
The following code creates an URLRequest and set some variables.
  var requset:URLRequest = new URLRequest("http://www.getImage.com");
  var vars:URLVariables = new URLVariables();
  vars.method = "GetImage";
  vars.ID = 123;
  requset.data = vars;
  
Output this URLRequest and its url and data property.
einfo(requset, "Info request and deep loop depth 0", 0, "url", "data");
Shown in the ETracer:
  [flash.net::URLRequest]
  url = http://www.getImage.com
  data = [flash.net::URLVariables]
  
Output it with the depth set to 1:
einfo(requset, "Info request and deep loop depth 1", 1, "url", "data");
Shown in the ETracer:
  [flash.net::URLRequest]
  url = http://www.getImage.com
  data = [flash.net::URLVariables]
   ID = 123
   method = GetImage
  
elog()function 
public function elog(value:Object, ... rest):void

Output log messages.

Parameters
value:Object — Log message to output.
 
... rest — rest Other odditional messages.

Example
The following code log the message that the image have been uploaded and the returned data from the server.
  private function onUploadCompleteData(e:DataEvent):void
  {
   elog("Upload complete data", e.data);
  }
  
etrace()function 
public function etrace(... arguments):void

Output debug information like the trace() method.

Parameters
... arguments — arguments One or more (comma separated) expressions to output.

Example
The following code output values of the mouseX and mouseY property.
etrace(mouseX, mouseY);
ewarn()function 
public function ewarn(e:Error):void

Outout warn infomation.

Parameters
e:Error — Warn infomation as an Error object.

Example
The following code output a warn.
ewarn(new Error("The target is not loaded yet."));
initETracer()function 
public function initETracer(target:DisplayObjectContainer, w:Number = 640, h:Number = 480, initX:Number = -1, initY:Number = -1, autoHide:Boolean = true):void

Initialize ETracer which show messages in the same swf. This operation will be ignored if whether the initETracer() or the initLcETracer() method have be called. The hot key to hide or show the ETracer is "Ctrl + Alt + X".

Parameters
target:DisplayObjectContainerDisplayObjectContainer to show the ETracer. Recommend to the stage.
 
w:Number (default = 640) — Width of the ETracer.
 
h:Number (default = 480) — Height of the ETracer.
 
initX:Number (default = -1) — X coordinate of the ETracer. In the horizontal center of the stage if initX is less than 0.
 
initY:Number (default = -1) — Y coordinate of the ETracer. In the vertical center of the stage if initY is less than 0.
 
autoHide:Boolean (default = true) — Hide the ETracer by the default.

Example
The following code initialize the ETracer to show messages in the same swf and set the width to 640, height to 480, in the center of the stage, not hide by the default.
initETracer(stage, 640, 480, -1, -1, false);
initLcETracer()function 
public function initLcETracer():void

Initialize ETracer which send messages by LocalConnection and show messages in another swf. This operation will be ignored if whether the initETracer() or the initLcETracer() method have be called.