# \[AS3\] Do I need an Object, an Array or a Dictionary?

**URL:** <https://forum.kirupa.com/t/as3-do-i-need-an-object-an-array-or-a-dictionary/232577>\
**Category:** classic bestof\
**Created:** [July 16, 2007, 5:29am UTC](https://forum.kirupa.com/t/as3-do-i-need-an-object-an-array-or-a-dictionary/232577 "2007-07-16T05:29:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rezmason](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/rezmason/32/30447_2.png) [@Rezmason](https://forum.kirupa.com/u/Rezmason)\
**Post date:** [July 16, 2007, 5:29am UTC](https://forum.kirupa.com/t/as3-do-i-need-an-object-an-array-or-a-dictionary/232577/1 "2007-07-16T05:29:01Z")

</div>

Hey, guys. Could someone tell me about when to use Arrays, Objects (associative arrays) and Dictionaries? My latest project iterates through a _slew_ of data, and I want to get the most out of my for loops.

All of the objects I’m iterating are of the same class, and there are about sixty-two thousand of them, at first. Optimization then brings the tally down to about six thousand, but I’m certain I can improve the data structure and logic of my program to run in tighter circles, so to speak.

I already understand the differences between Dictionary, and Object and Array implementation. I would like to know which is more suitable for different tasks. I’m using more Arrays now than I know I ought to, but what’s nice about them is when you’re iterating through something huge (like sixty-two thousand elements), a for loop going through an array can stop at a certain index, wait, and continue, so that Flash doesn’t time out. A for-in loop won’t do that, and as far as I know, you can’t iterate through Objects or Dictionaries by index.

So. Recap: what should I store my data-slew in, to get the most out of Flash?
