1 Attachment(s)
Passing a variable to a dynamic text field
I have been trying to create a small hangman game. I have a variable that is created from an array and is passed to a dynamic text field from another scene into the main scene and inside a movieclip. I know it must be just my referencing, but I have tried everything and it's driving me crazy.
It looks like this (which might mean nothing so I have included the file for download):
hangman.prototype.getWord = function() {
randomNumber = Math.round(Math.random()*(wordlist.length-1));
selectedWord = wordList[randomNumber];
lettersLeftToGo = selectedWord.length;
for (i=0;i<selectedWord.length;i++){
lettersNeeded[i] = selectedWord.charAt(i);
}
for (i=0;i<selectedWord.length;i++){
lettersGuessed[i] = "?";
}
this.interface.display = lettersGuessed.join("");
trace(this.interface.display);
}
Thankyou!!