Google
 
Webnews.only-4-geeks.com
Interesting places
news.only-4-geeks.com Forum Index » Flash - ActionScript

after 6 buttons are pressed jump to a new frame

 
Jump to:  
 
foowoo
PostPosted: Tue Sep 02, 2008 6:03 pm    Post subject: after 6 buttons are pressed jump to a new frame
       
I have made a spot the differece game as you may have seen in another post. I
have all the invisble buttons on one frame. When the button is pressed it
reveals a correct answer, that button also then becomes inactive so you can not
turn the answer off.

I have 6 buttons in total btn1 - btn6

How do I write the code so that after all the buttons have been pressed it
jumps to a finsihing frame.

I am also working flash 7 mx2004

someone suggested the below but I'm sure how it works

Create a root variable, _root.buttons_pressed = 0;
Then, in each button onDown actionscript, _root.buttons_pressed++;
Finally, you'll want to reset the counter when you enter the new frame,
again setting _root.buttons_pressed = 0;

Thanks in advance.

FooText
 

 
Kol-001
PostPosted: Tue Sep 02, 2008 7:06 pm    Post subject: Re: after 6 buttons are pressed jump to a new frame
       
Hi foowoo,

I may be wrong but aren't variables accessible throughout a timeline?

If so then my suggestion would be to set up a variable in the first frame and,
like suggested, have it increment with each button pressed (that is then
disabled so it doesn't count up again) in the frame where the game is. If my
theory is right then there's no need to reference _root. as it is all in the
same timeline, just call the variable something like gameCounter and use that.

Then I'd have a If gameCounter == 6 function which then does the resetting of
the variable to 0 and sends the user to the finishing frame.

Cheers

kol
 

Page 1 of 1 .:.

Google
 
Webnews.only-4-geeks.com

Windows Update | C++ | C | PHP | JavaScript | Photoshop | Programming | Windows 2000 | Python | Windows XP | Object | Flash | Flash - ActionScript | Paint Shop Pro | Excel | PowerPoint | Access | Word | Windows 98 | Internet Explorer 6.0 | CorelDraw12 | Java | XML | asm x86 | Linux Mandrake | Linux RedHat | Outlook |  | news from newsgroups |_ | s

Web Templates

Awesome Website Templates ©

Interactive agency części do maszyn volvo poker online hale namiotowe zabawki edukacyjne