views:

221

answers:

2

I have two AS3 classes, A and B. Class A contains an ArrayCollection that will hold multiple instances of class B.

In ColdFusion, I have matching CFCs, with same-named variables in the same order, as well as cfproperty tags for each variable.

The AS3 classes both use the RemoteClass metadata to associate them with their CFC counterparts.

The problem is that, while A.cfc comes back from CF and populates the A.as instances appropriately, I can't get any of the nested B.as instances to populate. Instead, I get this error:

TypeError: Error #1034: Type Coercion failed: cannot convert []@2f4465f1 to mx.collections.ArrayCollection.

Why would the A instance work fine except for the collection of its nested B instances?

A: 

Is this blog post of any help?

dirkgently
I saw that post, but I'm currently doing everything that he ended up changing his app to. I found the answer, stupid as it was. See the related answer on this post.
I Never Finish Anythi
+2  A: 

The problem was that the object was coming back from ColdFusion as an array and Flex didn't want to convert that into an ArrayCollection for me. Flex will turn a ColdFusion query into an ArrayCollection, but a ColdFusion array apparently can only be an Array (automatically) in Flex.

I changed the ArrayCollection in Flex to an Array and everything works fine.

I Never Finish Anythi
Great! you found what you were looking for.
dirkgently