I just found this out the hard way, but you shouldn’t cast the error property of an UncaughtErrorEvent. I was doing the following in my uncaught error event handler:
1 2 3 4 5 6 7 8 9 | private function onUncaughtErrorEvent(event:UncaughtErrorEvent):void {
event.preventDefault();
event.stopImmediatePropagation();
if(event.error is Error) {
log(Error(event.error).getStackTrace());
}else if (event.error is ErrorEvent) {
log(ErrorEvent(event.error).text);
}
} |
The problem with this is that it returns your uncaught error event handler as the last step when you call getStackTrace(). But changing your code a little will give you the real source of your error. Maybe everyone else knew this already, but I’m logging it here on my blog so I don’t forget.
1 2 3 4 5 6 7 8 9 | private function onUncaughtErrorEvent(event:UncaughtErrorEvent):void {
event.preventDefault();
event.stopImmediatePropagation();
if(event.error is Error) {
log((event.error as Error).getStackTrace());
}else if (event.error is ErrorEvent) {
log(ErrorEvent(event.error).text);
}
} |
I took some time to get familar with AIR development on the Blackberry Playbook. Overall it was pretty easy to get started but I did run into a few hurdles that I had to overcome to get the SDK and Simulator installed on Windows 7 64-Bit.
