On Sat, Jan 3, 2009 at 4:24 AM, jeremysavoy <jeremysa...@yahoo.com> wrote:
> I have an array collection that is a collection of ContactVO items. > When I debug and look at the ArrayCollection, each item, [0], [1], etc > is of type ObjectProxy, and inside each of these there is an "object" > that then contains the ContactVO fields. I'm assuming they are > ObjectProxy because I implemented the fix outlined at the bottom of > this page: > > http://livedocs.adobe.com/flex/2/langref/flash/events/IEventDispatcher.html > > The problem, is that when I try to assign an item in the > ArrayCollection directly to a ContactVO object as here: [snip] > I then get the following error on the assignment line number (last > line of code above). > > TypeError: Error #1034: Type Coercion failed: cannot convert > mx.utils::objectpr...@10eee479 to com.myproject.vo.ContactVO I don't think I fully understand your problem, but normally in a situation like this I would use an interface. You would end up with a ContactProxy that wraps the ContactVO, and both implement the IContactVO interface. And if that's overkill, maybe just refer to the ContactVO directly: __model.contact = __model.myAC[i].object; Manish