Help - Search - Members - Calendar
Full Version: Flash Actionscript Code.
Sal's RuneScape Forum > Everything... Not RuneScape > Tech Talk > Programming & Web Development
Amanda
Hey for my flash game i want users to get passcodes from reaching a certain level, then when they've got it they can come back on anytime, input their passcode and carry on where they left off.

I found a code but it only allowed one passcode, is there any way that multiple codes can be put in?

Thanks.
R Anderson
You could store all the passcodes in an array and then have a for loop run thorugh and check the entered string against the array of passcodes.

Or what would be much simpler if you do not have a ton of levels is for every level that has a passcode make a simple if statement:

CODE
lvl4passcode = text

if (userPasscode == lvl4passcode) {
send the person to that level
}


and do that for all the passcodes.
cjgone
You probably should use Switch\Case over if statements.
Amanda
I tried the code out but it didn't work, i probably put things in the wrong place? Could you explain more please?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.