Glad that was able to help you out :)

I dont know about a double cast per se, but I can tell you about why we needed this cast.  If you notice our handler gets a resultEvent object back.  We access the "result" property of that event.  If you look at the docs here:
http://livedocs.macromedia.com/labs/1/flex/langref/mx/rpc/events/ResultEvent.html
You will see that the result property is typed as a generic object. This is done so we can return any data we need to from our remote services.  In our case though we are using that result in the constructor of our ArrayCollection.  The ArrayCollection can take an array as a constructor argument, but as far as flex knows event.result is just an object.  So we cast it to Array datatype to fullfil this requirement.

As for the other cast, without going back in the history of the thread, I can only guess.  My guess is that the items in the array need to implement a certain interface, and for the same reason as above ( result as a generic object) you needed to cast it to the correct type.

Hope that helps clear things up.  Glad you got thing running.

simeon


On 4/18/06, sufibaba <[EMAIL PROTECTED] > wrote:

Simeon,

You are a LEGEND... Been wacking my head on this.  That did the
trick.

BTW, why is it that it one has to do a double cast.  In
PhoneCairngorm from Benoit, the compiler didn't need this extra
casting.  Is this some sort of bug do you think?


Tim

--- In flexcoders@yahoogroups.com, "Simeon Bateman" <[EMAIL PROTECTED]>

wrote:
>
> for the first part of your problem I think you need to cast the
results as
> an array
>
> change
> model.categoryList = new ArrayCollection(event.result);
> to
> model.categoryList = new ArrayCollection(event.result as Array);
>
> I have something similiar in my app and this is how I get around
the
> implicit type cast.
>
> simeon
>
>





YAHOO! GROUPS LINKS






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to