# Problems with eval() and loop variable

**URL:** <https://forum.kirupa.com/t/problems-with-eval-and-loop-variable/196475>\
**Category:** Uncategorized\
**Created:** [August 8, 2006, 6:38pm UTC](https://forum.kirupa.com/t/problems-with-eval-and-loop-variable/196475 "2006-08-08T18:38:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![obsidianchrysal](https://avatars.discourse-cdn.com/v4/letter/o/b487fb/32.png) [@obsidianchrysal](https://forum.kirupa.com/u/obsidianchrysal)\
**Post date:** [August 8, 2006, 6:38pm UTC](https://forum.kirupa.com/t/problems-with-eval-and-loop-variable/196475/1 "2006-08-08T18:38:17Z")

</div>

okay, i’m trying to dynamically populate the value ot a text  
field using a FOR loop. like this.

````auto

```

for (i = 1; i <= 31; i++) {
  eval("movieClip_" + i + ".textField.text = '" + i + "'");
}

```
 
this doesn't produce any output in the swf file. i believe
it's because of the eval function, because if i run a TRACE,
it comes back correct.  

any ideas ???
````
