How to iterate through arraycollection in flex
Copy link to clipboard
Copied
How to iterate through arraycollection in flex
Copy link to clipboard
Copied
for ( var x:int = 0; x < ac.length; ++x )
{
trace(ac.getItemAt(x).property);
}
OR
for ( var o:Object in ac )
{
trace(o.property);
}
Fixed the item access in the first example.

Copy link to clipboard
Copied
Hi ,
Infact it is..
for ( var x:int = 0; x < ac.length; ++x )
{
trace(ac.getItemAt(x).property);
}
OR
for ( var o:Object in ac )
{
trace(o.property);
}
Thanks,
Chari

Copy link to clipboard
Copied
or a foreach loop, or a while loop, or a dowhile loop.
just research into loops
Copy link to clipboard
Copied
Yep. It's early and I screwed up! The thing to remember with the ArrayCollection is that it is simply a wrapper around an underlying Array that carries an object-oriented design along with some additional functionality such as enhanced sorting.
A quick web search may yield many examples of this faster than the forum.
