# Incremental Variable Names

**URL:** <https://forum.kirupa.com/t/incremental-variable-names/174417>\
**Category:** flash\
**Created:** [January 5, 2006, 3:32pm UTC](https://forum.kirupa.com/t/incremental-variable-names/174417 "2006-01-05T15:32:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![zhais](https://avatars.discourse-cdn.com/v4/letter/z/ad7895/32.png) [@zhais](https://forum.kirupa.com/u/zhais)\
**Post date:** [January 5, 2006, 3:32pm UTC](https://forum.kirupa.com/t/incremental-variable-names/174417/1 "2006-01-05T15:32:10Z")

</div>

I’m having a few issues with incrementing numbers in variable names, was wondering if I could get some help :jail:

The below code is what I’m trying to implement, but I keep getting errors.

```auto

for( var i = 0; i < __values.length-1; i++)
  {
   this.createTextField("__intervalVal"+i, i*200, 0, 0, 20, 20);
   ["__intervalVal"+i].text = *codestuff*;
   ["__intervalVal"+i]._x = *codestuff*;
   ["__intervalVal"+i]._y = *codestuff*;
  }

```

The error I get with this code is:

**Error** Unexpected ‘.’ encountered  
["\_\_intervalVal"+i].text = _codestuff_

**Error** Unexpected ‘.’ encountered  
["\_\_intervalVal"+i].\_y = _codestuff_

So the main question(s) are: What’s the correct syntax for altering the text field I created with the incremental variable?

And why am I not getting an error message for the ["\_\_intervalVal"+i].\_x line? 0.o
