So I'm makeing a jeopardy game. I started it along time ago and now its crunch time to finish it. I have all of the catagory values as buttons. They are all set to goto a frame when they're clicked. on this frame is where the question will be displayed. Heres where my 2 questions come up.
Question 1:
how can I mike it so that when i click a button a textbox with the answer to the question appears?
Question 2:
how can i set it, so that when i click the button to return to the board, it hides the button to bring you to the question you just left(in english: when you return to the board that value which you just answered is no longer displayed, so you don't pick it again, like real jeopardy) and so that it stays hidden in the future after you chose different questions.
I really need this ASAP or else I'll be forced to use powerpoint for the jeopardy game and i'd really like to avoid that.
1: I would suggest setting the text boxs initial visibility flag to false using: myTextBox._visible = false;
then when the button is clicked set it to true.
2: Make an array then lets say theres 5 rows per column(i dont know the actual number) then all you have to do is name the instances on the stage go from top->bottom left->right with an incrementing value(1,2,3,4,etc...) then set the initial values of your array to false, if im not mistaken flash does this automatically. Then whenever one is clicked on set its corresponding array value to true, then somewhere have a loop going through the array like this:
for(i=0;i<=myArray.length;i++){
if(myArray[i]){
_root[i]._visible = false;
}
}
ok, well you solved #1 for me, but I'm a littel confused with #2. I've never delt with array's before, I assume it can't be to hard. Theres a total of 35 choices, 7 down, and 5 over.
well, arrays are very easy to use. see them as i very small database. in an array each entry gets it's own ID so it is easy to track down. The ID is a number witch makes it even more easy to work with it withing math functions.
e.g.
myArray = Array("name", "other name", yet another name");
trace (myArray) would output something like this.
_level0.myArray [
0: name
1: other name
2: yet another name
]
Thus, if I have 100 butons in a frame that do basicly the same thing, I'm NOT going to write 100 times an identical script. I would name the buttons in a similar way and than use an array to set the function. In you're case you could set the 35 buttons in a 'single' line of script.
I can help you out if you can tell me more exact what it is that you want..
ok, well basically, i have the 35 buttons, lets just call them #1-35. Each goes to a new frame when clicked. I want it so that when I return from that frame the button I used the first time is no longer visible. That way each jeopardy question can only be clicked on once, and the game will be over when all the buttons are hidden.
why use 35 frames to set this up. if you script this with arrays and dynamic text you could (in theory) do this in one frame using one button and 6 lines of text.
Do you have a basic setup online ?
How are the questions answered, checkboxes or text or something else ??
did you ever figure out how to do the jeopardy game? I am also working on one that I need to have done by the middle of August. I can't figure out how to make the squares marked after they've been chosen.
Ok I fixed it so that when you click on the button, it wont be clickable after coming back from the question/answer screen. I only did it with the first button, but Ill explain how to do it so you can finish the others.
First of all you can never give instance names starting with a digit. They always have to begin with a letter. So for your first button, I changed it so that the instance name was bt_1. Change the instance names for each of your buttons now.
Now, if you click on the first button and open its actions, you will see that the code looks like:
code:
on (release) {
gotoAndStop (2);
_root.bt_1.enabled = false;
}
After changing the instance names of each of the buttons, place that same code on each of the buttons. Change the bt_1 to the correct number.
Thats pretty much it. Just one final thing , your stop(); action was written wrong but for some reason worked. Remeber its a lower case 's' and not an upper case one.