# Button Counter Problem?!?!

**URL:** <https://forum.kirupa.com/t/button-counter-problem/171764>\
**Category:** flash\
**Created:** [December 8, 2005, 12:46am UTC](https://forum.kirupa.com/t/button-counter-problem/171764 "2005-12-08T00:46:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![maxoys45](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/maxoys45/32/1122_2.png) [@maxoys45](https://forum.kirupa.com/u/maxoys45)\
**Post date:** [December 8, 2005, 12:46am UTC](https://forum.kirupa.com/t/button-counter-problem/171764/1 "2005-12-08T00:46:49Z")

</div>

Basically i wanted to make a fun game where you need to click two different button alternatively to increase a counter. i named the two buttons “blue” and “red”. the problem im having is that you can just click one button continuously without having to switch and the counter still goes up. here is how i coded it (i know it is probably not the best way :D)

on(press) {  
\_root.red.gotoAndStop(2); // on frame 2 there is no code so you should not be able to click again  
\_root.number.nextFrame(); // this makes the counter go up frame by frame

\_root.blue.gotoAndStop(1); // this puts the other button to the frame with code  
}

i would like it so you have to press the red button then blue then red etc… to make the counter go up. ty

p.s  
i have added the fla file to explain this better
