forked from: trace current method
/**
* Copyright makc3d ( http://wonderfl.net/user/makc3d )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/2xD6
*/
// forked from 9re's trace current method
package {
import flash.system.Capabilities;
import flash.text.TextField;
import flash.display.Sprite;
public class FlashTest extends Sprite {
private var traceField:TextField;
public function FlashTest() {
traceField = new TextField;
traceField.width = traceField.height = 465;
addChild(traceField);
methodA();
}
private function methodA():void {
traceNow('1', 2);
methodB();
}
private function methodB():void {
traceNow(new Date);
}
private function traceNow (...msg:Array):void {
var at:String = "";
if (Capabilities.isDebugger)
at = (new Error).getStackTrace ().split ('\n') [2];
traceField.appendText((msg ? msg.join(' ') : '') + at + '\n');
}
}
}