[RESOLVED] Load variables
Hello. I have long time trying to achieve this. I have this riddle/enigmatic html game, with a flash button for entering the keys to suceed to the next level.
All the buttons from all levels are working 100% because the password variable is written in the same flash button. But the thing comes when in the level 5, i want to have random keys, that only will be shown when playing a PONG game. That works too, when you beat the PONG game, a random key/password/code, appears. The problem is loading the vars for the button.
I have a button with "btn" as instance name, and an input text field with "passW" as variable name. The keys are in a text file named Passwords2.txt
The keys are written like this:
PHP Code:
&myPassword=atari
&myPassword2=nintendo
&myPassword3=sega
&myPassword4=flash
&myPassword5=shockwave
&myPassword6=adobe
&myPassword7=arcade
&myPassword8=gaming
&myPassword9=actionscript
&myPassword10=coding
Then i have this in the first frame:
Actionscript Code:
loadVariables ("Password2.txt");
and in the button:
Actionscript Code:
on(release){
if (passW == myPassword || passW == myPassword2 || passW == myPassword3 || passW == myPassword4 || passW == myPassword5 || passW == myPassword6 || passW == myPassword7 || passW == myPassword8 || passW == myPassword9 || passW == myPassword10) {
getURL("nivel6.htm", "_self");
}
else {
getURL("error.htm", "_self");
}
}
The only thing that works is, if you type anything wrong, it goes to error.htm. That's ok. But when you type the correct keys (adobe, atari, flash...) it goes to error.htm TOO! Also, when there is nothing in the input text box, and you press the button, it goes to nivel6.htm!!!! Without writing any key!
Ideas? Help? Thanks