Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do I use multiple If statements? 2

Status
Not open for further replies.

TulsaJeff

Programmer
Jan 29, 2001
870
US
I am setting up a secure area for one of my clients and need to have 20 to 30 separate passwords that will allow access...maybe more. Is this sensible to do this in flash using multiple If statements and if so..what is the actionscript for it?

I have it set up for (1) password now and works fine. Here is my code so far:

if (password== "open") {
gotoAndPlay ("enter");
} else {
gotoAndPlay ("stayout");
}
Ya' Gotta Love It!:)X-)
 
Well... Since it works the way you're doing it, adding any number of if statements shouldn't change anything... Even in the speed of the whole thing! But it might be tedious work if you want to add new passwords.

Might be a possibility to script this in a way that condition is checked against a read array, rather than to individual passwords, making it easier to update this array independently from & not affecting the Flash movie itself.

Just a thought!

B-)
 
if (<not set yet>) {
gotoAndPlay (1);
} else if (<not set yet>) {
gotoAndPlay (1);
} else if (<not set yet>) {
gotoAndPlay (1);
} else if (<not set yet>) {
gotoAndPlay (1);
} else if (<not set yet>) {
gotoAndPlay (1);
} else if (<not set yet>) {
gotoAndPlay (1);
} else { <<<<if none match
gotoAndPlay (&quot;noentry&quot;);
}


should work
dave
dave@davdesign.co.uk

^^^^^^^^^^^^^^^^
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top