Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
Locked
0

How to iterate through arraycollection in flex

New Here ,
Aug 02, 2010 Aug 02, 2010

How to iterate through arraycollection in flex

20.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Aug 02, 2010 Aug 02, 2010
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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 02, 2010 Aug 02, 2010

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 02, 2010 Aug 02, 2010

or a foreach loop, or a while loop, or a dowhile loop.

just research into loops

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Aug 02, 2010 Aug 02, 2010
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines