HenryG
05-15-2008, 04:05 PM
Hi guys, i made the following script and this _should_ be working but apparently i can't see the error.
The script is supposed to make the word "hello" after going through the alphabet finding the right individual letter. At the moment all it seems to be able to do is get the first letter to spin!
any ideas would be great :)
stop()
vSecretWord = "hello";
vWordBox = "*****";
vGuess = "";
vCharIndex = 0;
onEnterFrame = function () {
if (vCharIndex<vSecretWord.length){
vRandomNo = random(26)+97;
vRandomChar = String.fromCharCode(vRandomNo);
vWordBox = vGuess+vRandomChar+"***";
if (vRandomChar == VsecretWord.charAt(vCharIndex)) {
vGuess = vGuess+vRandomChar;
vCharIndex++;
for (i=0; i<vSecretWord.length-vCharIndex-1; i++) {
vWordBox = vWordBox+"*";
}
}
}
};
The script is supposed to make the word "hello" after going through the alphabet finding the right individual letter. At the moment all it seems to be able to do is get the first letter to spin!
any ideas would be great :)
stop()
vSecretWord = "hello";
vWordBox = "*****";
vGuess = "";
vCharIndex = 0;
onEnterFrame = function () {
if (vCharIndex<vSecretWord.length){
vRandomNo = random(26)+97;
vRandomChar = String.fromCharCode(vRandomNo);
vWordBox = vGuess+vRandomChar+"***";
if (vRandomChar == VsecretWord.charAt(vCharIndex)) {
vGuess = vGuess+vRandomChar;
vCharIndex++;
for (i=0; i<vSecretWord.length-vCharIndex-1; i++) {
vWordBox = vWordBox+"*";
}
}
}
};