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+(10i),92,20,20);
_root.moveTo(55+(10i),92);
_root.lineTo(55+(10*i)+30,92);
[“pos”+i].variable=“letter”+i;
}[/SIZE][/COLOR]