-
keyword jump to frame
Hi all,
I'm trying to create a movie, that when a correct word is entered, it goes to a specified frame. The code below words fine but I need to make an addition to it, which is where I need a bit of help…
on (release, keyPress "<Enter>") {
if (inputtext eq "word1") { gotoAndStop("frame1");
} else if (inputtext eq "word2") { gotoAndStop("frame2");
} else {
inputtext = "";
}
}
I was hoping to add extra words that would go to the same frame. I know I ca do this by…
if (inputtext eq "word1") { gotoAndStop("frame1");
} else if (inputtext eq "word3") { gotoAndStop("frame1");
but was wondering if there is an easier way, something along the lines of…
if (inputtext eq "word1", "word2", "word3") { gotoAndStop("frame1");
Any ideas?
-
As you are using "eq", I see you're programming in ActionScript 1. So, I suggest you to use the next line:
Code:
if (inputtext eq "word1" or inputtext eq "word2" or inputtext eq "word3") { gotoAndStop("frame1");
In ActionScript 2, "eq" is replaced with "==", and "or" is replaced with "||" (double pipe). So, in AS2 your line code should be written like this:
Code:
if (inputtext == "word1" || inputtext == "word2" || inputtext == "word3") { gotoAndStop("frame1");
Use the first line first, and if you have an error, try the second one.
Let me know if it works.