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?