# Creating variable that has a variable in it's name

**URL:** <https://forum.kirupa.com/t/creating-variable-that-has-a-variable-in-its-name/321276>\
**Category:** flash\
**Created:** [April 14, 2011, 8:00pm UTC](https://forum.kirupa.com/t/creating-variable-that-has-a-variable-in-its-name/321276 "2011-04-14T20:00:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xandat](https://avatars.discourse-cdn.com/v4/letter/x/9de0a6/32.png) [@Xandat](https://forum.kirupa.com/u/Xandat)\
**Post date:** [April 14, 2011, 8:00pm UTC](https://forum.kirupa.com/t/creating-variable-that-has-a-variable-in-its-name/321276/1 "2011-04-14T20:00:16Z")

</div>

I’m getting really confused and trying to save myself alot of code, haven’t been able to google a solution.

On the timeline I need a set of variables for each number of TotalNumber  
as an example ill use the variable w

for (il = totalNumber; il \> 0; il–){  
var [w +il]:int = 100;  
}  
trace(w +1);

doesn’t work. At the end i need about 5 sets of 7 different variables, but be able to change the number of sets, thats why this is pretty critical

Thanks if you can help!
