I'd recommend having the IOError even handler dispatch another event
that you listen for.

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Dennis Falling
Sent: Wednesday, May 14, 2008 6:06 PM
To: [email protected]
Subject: [flexcoders] Catch exceptions outside of try block?

 

I'm sure I'm going at this wrong, but don't know what to do...

I'm setting the data of a custom component with an image element.  When
the component finishes starting up the image grabs its source from the
data provider and a function catches the IOError event and throws its
text as an exception so the application can know about the failure.

The problem I'm having is with the delay between the set data and
creation complete of the component.  By the time the image tries to
access the source (and fails), my application is past that try/catch
block and can't handle it.

What's the right way to do this?  Better yet, is there a way in flex to
try to access various different kinds of files to see if the address is
valid?

Thanks!
-dennis

 

Reply via email to