# Question about dynamic text variables

**URL:** <https://forum.kirupa.com/t/question-about-dynamic-text-variables/129170>\
**Category:** Uncategorized\
**Created:** [November 20, 2004, 8:23am UTC](https://forum.kirupa.com/t/question-about-dynamic-text-variables/129170 "2004-11-20T08:23:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tyler](https://avatars.discourse-cdn.com/v4/letter/t/35a633/32.png) [@Tyler](https://forum.kirupa.com/u/Tyler)\
**Post date:** [November 20, 2004, 8:23am UTC](https://forum.kirupa.com/t/question-about-dynamic-text-variables/129170/1 "2004-11-20T08:23:08Z")

</div>

I am having problem in the last line of code, where I try to call each textField by its instance name and set a variable name according to the changing value of I. When I try to test the movie I have an AS error poiting at the way I wrote [COLOR=Blue][SIZE=1][“pos”+i].variable=“letter”+i;[/SIZE][/COLOR]  
I feel like its an easy one but its 3:17 and my brain is telling me to go to sleep so I hope someone out there can help me.

[COLOR=Blue][SIZE=2]// Declare array with a list of words

words=[“eat”,“sleep”,“run”,“jump”];  
wordToGuess=words[Math.round(Math.random()\*(words.length))];  
trace(wordToGuess);

//Create as many TextBox as the number of letter in the chosen word

for(i=0;i\>=words.length;i++){  
\_root.createTextField(“pos”+i,10+i,55+(10_i),92,20,20);  
\_root.moveTo(55+(10_i),92);  
\_root.lineTo(55+(10\*i)+30,92);  
[“pos”+i].variable=“letter”+i;  
}[/SIZE][/COLOR]
