on (release, keyPress <Enter>) {
if (password eq aikotoba) {
gotoAndPlay(2) ;
password = ;
} else {
gotoAndPlay (3) ;
password = ;
}
}
That looks like a lot, but its not. Its an function that tells Flash to use an if statement when the mouse clicks the Enter key is pressed.
The if statement checks to see what the characters entered for password are, and compares them to a value set by you: the actual correct password, inside the quotes. If the two are the same, then Flash will go to the access granted frame/scene (frame two, for me). If not, the else statement redirects to the wrong answer, try again screen. In both instances, the password is reset to nothing, so that its not carrying the entered string around.
In mine, aikotoba is the correct password; if the user enters aiko, then password=aiko. Flash asks itself, does aiko equal aikotoba? and, when the answer is no, shunts them off to the wrong answer screen.
Note that the if statement uses eq instead of = to see if theyre the same; this is because its comparing two character strings, and not comparing an actual value.


