|
-
IF / Else help for matching game
Hi guys,
I'm a real Flash noob. Trying to make a game where you click a box and it disappears and reveals content below it for a matching game where you find like flags (like US flag, Italian, etc) and I am trying to work with IF/Else in Flash CS3, but I haven't done code since Flash MX and I'm lost in the newer UI.
Anyway, I'm working in Actionscript 2.0 because 3.0 still scares me and here is my code:
on (press) {
if (thecount = 0){
_root.A1._visible=false;
set (_root.thecount, 1);
} else if (thecount = 1){
_root.A1._visible=false;
set (_root.thecount, 2);
} else {
stop();
}
}
I have a series of "rectangle covers" on top of flag graphics. What I want to happen with the code above is to have it so when the variable thecount is 0 or 1, a mouse click will turn a rectangle cover invisible to show a flag, and if thecount is anything else, I don't want anything to happen when the user clicks on the rectangle cover.
I found out that I needed (or maybe I don't) the _root for the visible code, but I can't figure out how to get the above IF/Else right. The above code right now makes the rectangle cover invisible (A1) invisible no matter what thecount equals.
Thanks for any help!!! Also i'm sorry i don't know the UBB to get the code above looking nicer :/
Last edited by G.v.P; 03-22-2009 at 09:01 AM.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|