Another way is:
if(re.result is ArrayCollection) {
var col:ArrayCollection = ArrayCollection(re.result);
}
The as operation is more brief but accomplishes the same thing. as
will leave your object as null, where as doing the is check you can
catch potential errors and not create any unnecessary objects. I don't
think either way is more right or wrong.
--- In [email protected], "ytseshred" <[EMAIL PROTECTED]> wrote:
>
> That was a typo on my Part. They are being set using methods:
>
> TestVO vo = new TestVO();
> vo.setID(rs.getInt("id"));
> vo.setData(rs.getString("data"));
>
> The problem has been solved by casting the result to ArrayCollection
> using the as keyword.
>
> I'm not sure what was causing my first problem, but I originally had
> my VO's defined with constructors, so I could create the VO like:
>
> TestVO vo = new TestVO(rs.getInt("id"), rs.getString("data"));
>
> But Flex gave a runtime error when it was constructing the array
> collection saying something like TestVO init expected 2 arguments and
> got 0.
>