# \[CS3, AS2\] Using a for loop to set properties

**URL:** <https://forum.kirupa.com/t/cs3-as2-using-a-for-loop-to-set-properties/309957>\
**Category:** flash\
**Created:** [May 28, 2010, 1:02pm UTC](https://forum.kirupa.com/t/cs3-as2-using-a-for-loop-to-set-properties/309957 "2010-05-28T13:02:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jimbobian](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@jimbobian](https://forum.kirupa.com/u/jimbobian)\
**Post date:** [May 28, 2010, 1:02pm UTC](https://forum.kirupa.com/t/cs3-as2-using-a-for-loop-to-set-properties/309957/1 "2010-05-28T13:02:19Z")

</div>

Hey,

So I have a php file which is grabbing data from the database, flash is then taking this and putting it into an array. But, how can I use a for loop to progressively name the array. I know you can do it for object names (\_root[“name”+variable].whatever), but how can i do it the other way round:  
array.push(id:“id”+i,players:“players”+i)  
To do this i currently have to do a huge list which is kinda annoying, and then if I had something to the database I have to manually tell flash to do it.

Any help appreciated.

Jimbobian
