I want to see the stack trace in any function of my code, so i made somthing like this to call it and print the stack trace:
public function PrintStackTrace(
var tempError:Error = new Error();
var stackTrace:String = tempError.getStackTrace();
write this stackTrace string into any file so that you can see the logs of your program at run mode also. So you need not to run it in debugger mode only. Write it into uncaughtexception event of application, so it will execute lastly.