When I run a Flex application in the debug flash player I get an exception pop up as soon as something unexpected happened. However when a customer uses the application he d
Alternative to accepted answer, using try-catch. Slower, but more straightforward to read, I think.
try {
loaderInfo.uncaughtErrorEvents.addEventListener("uncaughtError", onUncaughtError);
} catch (e:ReferenceError) {
var spl:Array = Capabilities.version.split(" ");
var verSpl:Array = spl[1].split(",");
if (int(verSpl[0]) >= 10 &&
int(verSpl[1]) >= 1) {
// This version is 10.1 or greater - we should have been able to listen for uncaught errors...
d.warn("Unable to listen for uncaught error events, despite flash version: " + Capabilities.version);
}
}
Of course, you'll need to be using an up-to-date 10.1 playerglobal.swc in order to compile this code successfully: http://labs.adobe.com/downloads/flashplayer10.html