|
View:
New views
2 Messages
—
Rating Filter:
Alert me
|
|
|
|
|
|
Re: NEED HELP with mtasc trace optionI'm using Firebug too for debugging, with a custom trace like this one (stripped a little because there was some unused code in when I tried to do some more with it, but never finished it).
You can get a lot more out of it, but I have never spent more time in it and mapped all console.error etc.
It does not include a variable dump or give a recursive trace of object etc, but it certainly can be useful. I use ant to build the projects, therein the following piece is added for using a custom trace (The class file is stored in the top package, not nested in directories). The second 'CustomTrace' after CustomTrace.trace is used to include the class in the swf.
<arg value="-trace"/> <arg value="CustomTrace.trace"/>
<arg value="CustomTrace"/>
import flash.external.ExternalInterface; class CustomTrace { public function CustomTrace()
{ } public static function trace(message:String, classMethod:String, file:String, line:Number):Void { var d:Date = new Date(); var timestamp:String = "[" + formatDate(d.getHours().toString(), 2) + ":" + formatDate(d.getMinutes().toString(), 2) + ":" + formatDate(d.getSeconds().toString(), 2) + "]";
var trace_message:String = ""; trace_message += timestamp + ": ";
trace_message += "" + classMethod + " "; trace_message += "" + message + "";
ExternalInterface.call("console.log", trace_message); }
private static function formatDate(dateString:String, len:Number):Object { dateString = "000000" + dateString;
dateString = dateString.substr(dateString.length - len, len); return dateString;
} } Hope this helps. - Joeri On Feb 4, 2008 1:26 PM, Selene Platt <selene@...> wrote:
-- MTASC : no more coffee break while compiling |
| Free embeddable forum powered by Nabble | Forum Help |