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
On 4/18/06,
sufibaba <[EMAIL PROTECTED]> wrote:
Ca Va Benoit,
When I do:
model.categoryList = new ArrayCollection(event.result);I get: Implicit coercion of a value with static type 'Object' to a possibly unrelated type 'Array'
When I do:
public function onResult(event:ResultEvent):void {
trace("categories = " + event.result)model.categoryList = ArrayCollection(event.result);
model.applicationState = Properties.STATE_DEFAULT;
}I get: no compiler error and I get the following from the debugger:
categories = [object CategoryVO],[object CategoryVO],[objectCategoryVO],[object CategoryVO],[object CategoryVO],[objectCategoryVO],[object CategoryVO],[object CategoryVO]
TypeError: Error #1034: Type Coercion failed: cannot convert [EMAIL PROTECTED] to mx.collections.ArrayCollection
I have your phoneCairngorm setup running fine but I am getting problems here.
Tim
--- In flexcoders@yahoogroups.com , "Benoit Hediard" <[EMAIL PROTECTED]> wrote:
>
> Have you tried to put a breakpoint in order to look in the debugger the
> structure of your result?
> You might also have a look with ServiceCapture
> (http://kevinlangdon.com/serviceCapture/).
> It's a "must have" tool for debugging RPC requests.
>
> The result is probably an array.
> So you might have to do :
> model.categoryList = new ArrayCollection(event.result);
>
> Benoit Hediard
>
--
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
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service .
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
YAHOO! GROUPS LINKS
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.