Hello,
I am horrible at actionscript and I hope some one can point me in the right direction. I basically have a Bingo card with the numbers called already. If the user clicks (marks) the right winning numbers the user wins. How can I program it to see if all the winning numbers have been clicked?
depends on how you are set so far. Could be an if/else if. Could be an Array, could be a switch(case) could be a for loop, while loop etc. if you have a script post it, if not post a mockup .fla.
Thanks. I saw those Bingo files too. Guess I thought it would be simpler than that. I'm really just trying to find out whether four buttons have been clicked or not. I don't need to generate numbers or fill the grid or anything like that.
Basically have four buttons and I'm trying to find out if they all have been clicked.
Ok. I'm back with some code. I've read up on a few things and thought this would work but it's still isn't for some reason.
On the first frame I'm declaring four variables (my buttons) set to false.
Each button has an action setting it to true.
Then my checker on the first frame of my mc:
Buttons.onEnterFrame = function() {
if (button01==true, button02==true, button03==true, button04==true) {
_root.gotoAndPlay(5);
}
};
Here is my test .fla. This is for Flash 6.
Any ideas?
Right now the mc that has the buttons and this script is running on Frame 4 of the main timeline. When all the buttons have been clicked I want it to go to Frame 5 or the next frame in the main timeline.
1 ) careful with scopes:
that script above, as is, is supposed to go on the main timeline. (you're talking to Buttons, which i guess is sitting on the main timeline)
2) the references to the variables buttons, as is, means that these 4 vars are declared ON the main timeline as well. meaning, you declare them all to false:
Now your buttons, i assume, are inside the MC Buttons, right?
So their action should be:
_root.button01 = true; //same for all 4 buttons: _root.button02 = true; ...etc.
3) careful with gotoAndPlay(x) : you can't tell the player head to gotoAndPlay() on a frame that has a stop() action on it. You need to decide if it plays or stops.... right?