In my application I want to have a dictionnary where the key is an integer.
Since it's an integer, I use normal Array
:
var arr : Array = [];
arr[5] = anObject;
arr[82] = anOtherObject;
When I iterate with for each
, no problem, it iterates through those 2 object. The problem is that arr.length
return 83... So I have to create a variable that count the number as I modify the array.
Question 1 : Is there a best practice for that (IE: associative array with int as key)? I hesitated to use a Dictionnary.
Question 2 : Does flash allocates memory for the unused buckets of the array?