# MX: Array-ID question

**URL:** <https://forum.kirupa.com/t/mx-array-id-question/159703>\
**Category:** flash\
**Created:** [August 19, 2005, 1:41pm UTC](https://forum.kirupa.com/t/mx-array-id-question/159703 "2005-08-19T13:41:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![CEOofAEP](https://avatars.discourse-cdn.com/v4/letter/c/7cd45c/32.png) [@CEOofAEP](https://forum.kirupa.com/u/CEOofAEP)\
**Post date:** [August 19, 2005, 1:41pm UTC](https://forum.kirupa.com/t/mx-array-id-question/159703/1 "2005-08-19T13:41:08Z")

</div>

Hello you all 🙂

I have a question about writing into / referring to entries in an array.

I have an array that I store names of players in. Each player has their own ID already and since I never “FOR” through the array, I figured I’d use the player ID as the array ID (to be able to refer to the entries of the array by the ID of the player).

The problem / reason for this thread is, some players have relatively high IDs (up in the thousands)… so my question is- does anyone know if Actionscript “reserves” the unused spots in an array while creating it? Like- if the loop in which I fill it ends up setting~  
arrayname[1] = “Something”;  
arrayname[100] = “Something”;  
arrayname[1000] = “Something”;  
~is the array 1000 entries long or 3? If I use “length” on it, it gives me “1000” (the highest used Array-ID) - but does it actually use up a few bits or bytes of RAM for reserving the empty spots in between?

I am working on increasing the performance of my Actionscript and I don’t want to eat up system performance by carrying around a 8000-entry array that only has 20 players stored in it…

I am assuming that Actionscript doesn’t clog up performance for something that isn’t there… but I could be wrong- you never know, with Actionscript 😉

Thanks in advance!
