PDA

View Full Version : hold on down state & detect when done game


DeeL75
03-17-2008, 02:06 AM
Hoping that someone will help me out. I'm creating this simple game for preschoolers. The object of the game is for the children to find the hidden letters (the entire alphabet) in an ancient city. This is where I'm stuck:

1. When the letter is found it should turn red, I have each letter set up as a button and I would make the red letter in the down state but what can I do to keep in the down state.

2. What coding do I use for my game to detect when all the letters are found, so that it can go to the next scene?

I'm submitting my file so you can see what I mean, sorry it's only the swf file.

MrFish
03-17-2008, 11:44 AM
How I'd approach this...

1. Make up all your on and off states for your letters.
2. Make a series of movieclips (2 frames each) Frame 1 has the "off" state, frame 2 has the "on" state.
3. Create an Invisible button (just the hit area)
3.1 -> To my knowledge you can't force a button to stay in it's down state
4. Add the hit area to the letters movieclips on the first frame only (once it's been clicked the clip advances to the "on" state and the invisible button is no longer available to click)
5. Create a variable called "letterCount" for reference.
6. Once the users clicked the button (found a letter), increment the "lettersFound" variable.
7. Once "lettersFound" == "lettersCount" you know the users found them all.

(p.s. This is how I'd do it in Flash8 or AS2 not sure about AS3 as I'm struggling with this myself at the moment)

Hope that puts you on the right track ;-)

DeeL75
03-18-2008, 12:48 AM
Mr.Fish you rock! :) I'm still pretty new to this so sometimes I don't think of these things. Thanks