The ArrayCollection is designed for object storage and not object value
retrieval. So. one way to get the value out of an object stored in an
ArrayCollection is to provide a context to work in as:

 

 trace( Foo( acTest[0] ).bar );

 

This assumes that the ArrayCollection is filled full of objects of type Foo
- the wrapper lets you 'peek' inside the object for its value.

 

Rick Winscot

 

 

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Mark Shen
Sent: Saturday, June 07, 2008 9:35 PM
To: [email protected]
Subject: Re: [flexcoders] How to get a item in Arraycollection?

 

It works with "trace(acTest.getItemAt(0).first);"

Thanks

Mark

----- Original Message ----
From: Richard Rodseth <[EMAIL PROTECTED]>
To: [email protected]
Sent: Saturday, June 7, 2008 6:04:01 PM
Subject: Re: [flexcoders] How to get a item in Arraycollection?

You can use acTest.getItemAt( 0)

acTest.source[ 0] also compiles.

If you are using Flexbuilder, Cntl-Space (or PC equivalent) gives you
"content assist", so just type it after the period and see what you
get.

On Sat, Jun 7, 2008 at 5:57 PM, markflex2007 <markflex2007@ yahoo.com
<mailto:markflex2007%40yahoo.com> > wrote:
> Hi,
>
> I have a demo here:
>
> acTest = new ArrayCollection( [{first: 'Matt', last:
> 'Matthews'}, {first: 'Jame', last: 'Wang'},{first: 'Rey', last:
> 'Chang'}]);
>
> trace(acTest. length.toString( ));
> trace(acTest. list.source[ 0].first) ;
>
> I want to use 'acTest.list. source[0] .first' to get "Matt".but I can not.
> Please let me know the correct syntax.
>
> I am new for Arraycollection and I like to learn.Please help me.
>
> Thanks a lot
>
> Mark
>
> 

 

 

Reply via email to