# Variable within variable?

**URL:** <https://forum.kirupa.com/t/variable-within-variable/248716>\
**Category:** flash\
**Created:** [January 11, 2008, 12:51am UTC](https://forum.kirupa.com/t/variable-within-variable/248716 "2008-01-11T00:51:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrgulabull](https://avatars.discourse-cdn.com/v4/letter/m/a9adbd/32.png) [@mrgulabull](https://forum.kirupa.com/u/mrgulabull)\
**Post date:** [January 11, 2008, 12:51am UTC](https://forum.kirupa.com/t/variable-within-variable/248716/1 "2008-01-11T00:51:04Z")

</div>

I’ve searched around and wasn’t able to find any solutions to my problem, which probably just means I’m going about this wrong way, but here it goes…

I have a bunch of variables named like so:

box0W  
box1W  
box2W  
box3W… and so on

I’d like to use a loop to call each of these variables without actually having to write them all out. The code below obviously doesn’t work, but hopefully gives you an idea of what I’d like to do.

```auto
i = 0
total = 7
while (i < total) {
    trace("box"+i+"W")
    i++
}

```

So this traces out the names of my variables, but I’d like to trace out the value of the variables instead. Truly appreciate any advice. Thanks!
