|
-
Password Coding Help
I'm trying to create a password input area where a player can insert several passwords and be correct, each password triggering the typing of that password in a separate area (which is what the numbers one to ten in the script below refer to). However, there is some flaw I can't find in the script and if I try to enter anything in the box, it is changed to "orangemarmalade" (see below) and only enters there (acting as if I typed "orangemarmalade" every time). Any one have any help?
on (release)
{
if (enterpassword = "orangemarmalade")
{
one = "orangemarmalade";
}
else if (enterpassword = "goldenafternoon")
{
two = "goldenafternoon";
}
else if (enterpassword = "andtheking")
{
three = "andtheking";
}
else if (enterpassword = "breadandbutterflies")
{
four = "breadandbutterflies"
}
else if (enterpassword = "rockinghorsefly")
{
five = "rockinghorsefly"
}
else if (enterpassword = "lobsterquadrille")
{
six = "lobsterquadrille"
}
else if (enterpassword = "momeraths")
{
seven = "momeraths"
}
else if (enterpassword = "maryjanes")
{
eight = "maryjanes"
}
else if (enterpassword = "mockturtle")
{
nine = "mockturtle"
}
else if (enterpassword = "marchhare")
{
ten = "marchhare"
}
else
{
enterpassword = "Try Again"
}
}
-
use double equal signs for comparison:
if(enterpassword == "marchhare")
a single = assigns.
gparis
-
 Originally Posted by gparis
use double equal signs for comparison:
if(enterpassword == "marchhare")
a single = assigns.
gparis
hmm, tried it, didn't help. Thanks for trying though :/
-
this should work, i think...
Code:
instancename.onRelease = function () {
if (passwordinputfield.indexOf("chosenword") or ("chosenword2") or ("chosenword3") != -1) {
//whateveryouwant here
}
}
paste into maintimeline just for the sake of keeping it all neat and tidy.
might be addicted to flash... 
_______________________________________
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|