Hi,
Please make sure your SWF is published as version 18. As indicated in the following document, this feature is available only for SWF version 18 and above.
http://www.adobe.com/devnet/articles/flashplayer-air-feature-list.html
Please also note that the stack traces generated in the non-debug version of the player will only show method names. For full stack trace info including file name and line numbers, a debug version of the player (see Content Debuggers available for download here: http://www.adobe.com/support/flashplayer/downloads.html) is required in addition to the SWF itself being published as a debug SWF.
Here's a sample usage of the feature:
package
{
import flash.display.Sprite;
import flash.text.TextField;
public class StackTraceTestCase extends Sprite
{
public var console:TextField = new TextField();
public function StackTraceTestCase()
{
console.width = stage.stageWidth;
console.height = stage.stageHeight;
console.border = true;
this.stage.addChild(console);
foobar1();
}
private function foobar1():void {
foobar2();
}
private function foobar2():void {
foobar3();
}
private function foobar3():void {
foobar4();
}
private function foobar4():void {
foobar5();
}
private function foobar5():void {
try {
var myVar:String = null;
/*
* This results in Null Reference error.
*/
console.appendText(myVar.toString());
} catch ( error:Error ) {
console.appendText(error.getStackTrace());
}
}
}
}
And the output generated by the non-debug version of the player:
TypeError: Error #1009
at StackTraceTestCase/foobar5()
at StackTraceTestCase/foobar4()
at StackTraceTestCase/foobar3()
at StackTraceTestCase/foobar2()
at StackTraceTestCase/foobar1()
at StackTraceTestCase()