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(
@hasseg is right. You can also preserve the stacktrace information in release version (not debug) by providing the -compiler.verbose-stacktraces=true when compiling your SWF.