Grass™
06-01-2007, 05:01 PM
Heres what i got, ignore all the unknowns they come from textboxes etc.
My problem is in this function I change the value of a variable. I want to store that variable change so i can use it in another function. Heres what i got.
function setupGame(){
var guessesLeft = guessNo.value = 10;
var wordSplice = new Array();
wordVal = word.value
wordVal = wordVal.toLowerCase();
alert(wordVal);
for(var i=0; i<wordVal.length; i++){
wordSplice[i] = wordVal.substring(i, i+1);
wordSoFar.value += "*"
}
}
Thats the first function, the variable or 'Array' values of wordSplice I saved I want to use in this function :
function runCoreEngine(){
for(i in wordSplice){
}
}
Really appreciate any help, if theres anything I was unclear on let me know I really need a solution. Cheers!
My problem is in this function I change the value of a variable. I want to store that variable change so i can use it in another function. Heres what i got.
function setupGame(){
var guessesLeft = guessNo.value = 10;
var wordSplice = new Array();
wordVal = word.value
wordVal = wordVal.toLowerCase();
alert(wordVal);
for(var i=0; i<wordVal.length; i++){
wordSplice[i] = wordVal.substring(i, i+1);
wordSoFar.value += "*"
}
}
Thats the first function, the variable or 'Array' values of wordSplice I saved I want to use in this function :
function runCoreEngine(){
for(i in wordSplice){
}
}
Really appreciate any help, if theres anything I was unclear on let me know I really need a solution. Cheers!