Skip to main content
December 17, 2009
Answered

Need a try/catch but IOErrorEvent doesn't seem to support it...

  • December 17, 2009
  • 1 reply
  • 356 views

I'm loading a remote image using a Loader and in the event the image is missing I want to substitute the missing image with a generic placeholder image.  Normally a try/catch construct would be perfect for this.  But with Loader, it throws an IOErrorEvent which then calls another function, and I am then thrown out of the context of my original function, so I can't easily do what I need to do.

Any ideas on how to get around this?  I'm having trouble understanding why some classes use try/catch while others throw error events.

Thanks!

This topic has been closed for replies.
Correct answer kglad

you'll need to use an ioerror event handler.

and, the difference between your error and try/catch amenable errors is the difference between asynchronous errors and synchronous errors

1 reply

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
December 17, 2009

you'll need to use an ioerror event handler.

and, the difference between your error and try/catch amenable errors is the difference between asynchronous errors and synchronous errors