Complete Overview: I'm making a fill-in-the-blank quiz. I want a button that checks the input text box and has two results depending on what is typed in the text box. If it is the correct text, a movie clip will play with the word "correct" and the "next question" button will appear. Also, the "correct" variable will increase by one. If it is not the correct text, a movie clip will play with the word "wrong" and the "next question" button will appear. Also, the "wrong" variable will increase by one. In addition, I want the "check answer" button to be disabled when the "next question" button has appeared.
Explanation: In this example, the correct answer is "test". An if statement defines that if the variable "var1" is "test", the positive effects happen. If it is not "test", the negative effects happen. Also, an if statement is added to check if the "next answer" button is on frame 1 (blank frame). If it is, the "check answer" button proceeds to check if "var1" is "test". If it is not, the button does nothing.
Basic Problem: I want to know how to use the inputted text as a variable and how to make that variable affect the outcome of pressing a button. I also want to make it impossible for the button to check the same answer again by checking if the "next question" button has appeared.
Question: What code would I use for the "check answer" button? In this instance, the correct inputted text is "test", the instance name of the input box is "q1", and the var for the input box is "var1". I know how to use variables, I just want to know how to make the inputted text a variable. Also, I want to know how to "stack" if statements so that one if statement will not be used if the previous one fails.
Any help would be appreciated. All I really need to know is how to use input text boxes.
I figured out how to use input text. It's done the same way as an instance name:
if (_root.var1 == "test") {}
For making the button not able to be clicked twice, I made it into a movie clip with a blank frame 1. After being clicked, it would go to frame 1. When each movie frame was loaded it will return the button to the correct frame.
Edited by Blue_Monkey, 16 January 2008 - 05:53 PM.
