Re: [flexcoders] error checking FileStream. readObject?

2010-07-20 Thread Roy Pardi
At 7:53 AM -0700 7/20/10, Rick Genter wrote:
>On Jul 20, 2010, at 7:38 AM, Roy Pardi wrote:
>
>> Is there a way to handle a FileStream. readObject error that results when
>> the target file does not contain valid object data? This isn't an
>> IOErrorEvent - but rather an error converting the read data.

>
>try/catch?

doh! Yes, thanks.
-- 
-
http://www.roypardi.com/





Re: [flexcoders] error checking FileStream. readObject?

2010-07-20 Thread Oleg Sivokon
Just use try-catch, I don't think there's anything special for this case.


Re: [flexcoders] error checking FileStream. readObject?

2010-07-20 Thread Rick Genter

On Jul 20, 2010, at 7:38 AM, Roy Pardi wrote:

> Is there a way to handle a FileStream. readObject error that results when
> the target file does not contain valid object data? This isn't an
> IOErrorEvent - but rather an error converting the read data.
> 
> The use case is that the user can pick a file to open. While I can filter
> the allowable files I wanted to also handle errors on the read end. Is this
> possible? Ex: the code below works fine when the file contains valid
> ArrayCollection data but I can break it if I try to open any other sort of
> file.
> 
> 
> fs.open(newFile, FileMode.READ);
> var temp:ArrayCollection= fs.readObject();
> fs.close();

try/catch?
--
Rick Genter
rick.gen...@gmail.com



[flexcoders] error checking FileStream. readObject?

2010-07-20 Thread Roy Pardi
Is there a way to handle a FileStream. readObject error that results when
the target file does not contain valid object data? This isn't an
IOErrorEvent - but rather an error converting the read data.

The use case is that the user can pick a file to open. While I can filter
the allowable files I wanted to also handle errors on the read end. Is this
possible? Ex: the code below works fine when the file contains valid
ArrayCollection data but I can break it if I try to open any other sort of
file.


fs.open(newFile, FileMode.READ);
var temp:ArrayCollection= fs.readObject();
fs.close();

-- 
-
http://www.roypardi.com/