I've set up a web site so that my users can log in if they have a password that matches one from my list of possible passwords.(hypothetical).
with out using a function and only using a for each loop and if, how do I check if userEnterName matches any of the four in nameCheck?
var nameCheck:Array = ["cowboy", "spaceman", "lowboy", "1withmany"];
var userEnterName:String = "";
for each(var n:String in nameCheck){
if(n == nameCheck[0],[1]){
trace("The password was found in the list");
}
else{
trace("The password was not in the list");
}
}
Checking user names with for each loop and if . . .
Thursday, June 7, 2012
[Action Script] Checking user names with for each loop and if . . . June,2012
Posted by Bimo Hery Prabowo at 7:13 AM
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment