0

I have an associative array and while iterating through this array, using foreach loop. Flex is loosing the order. This is so annoying.

Why is this happening?

How can i avoid this?

DarthVader
  • 52,984
  • 76
  • 209
  • 300

2 Answers2

5

Per the specification, the values in an associative array are not "ordered".

If you need to get values in a specified order, you'll need to sort the keys yourself.

Anon.
  • 58,739
  • 8
  • 81
  • 86
5

Associative arrays are implementation of the Hash table data structure, and hence are unordered by nature.

Bozho
  • 588,226
  • 146
  • 1,060
  • 1,140