Anyone else unable to listen to uncaughtErrorEvent when loaded by another swf?

Posted by aaaidan on Stack Overflow See other posts from Stack Overflow or by aaaidan
Published on 2010-06-11T05:00:01Z Indexed on 2010/06/11 5:02 UTC
Read the original article Hit count: 593

Filed under:
|
|
|

When I try to access the uncaughtErrorEvents dispatcher when loaded directly, everything works well. But when I try the same code when loaded by another swf I get a reference error.

protected function onAddedToStage(e:Event):void {
    trace("Flash version: " + Capabilities.version);
    try {
      loaderInfo.uncaughtErrorEvents.addEventListener("uncaughtError", onUncaughtError);
      trace("YAY!");
    } catch (e:Error) {
      trace(e);
    }
}

Output when loaded directly (in browser):

Flash version: MAC 10,1,53,64
YAY!

Output when loaded by another "loader" SWF:

Flash version: MAC 10,1,53,64
ReferenceError: Error #1069: Property uncaughtErrorEvents not found on flash.display.LoaderInfo and there is no default value.

If others can replicate this I'd be appreciative.

EDIT: Also have tried this with stage.loaderInfo, instead of just loaderInfo. Same issue...

© Stack Overflow or respective owner

Related posts about flex

Related posts about flash