# Alternate Button pressing increments a bar

**URL:** <https://forum.kirupa.com/t/alternate-button-pressing-increments-a-bar/174529>\
**Category:** flash\
**Created:** [January 6, 2006, 1:25pm UTC](https://forum.kirupa.com/t/alternate-button-pressing-increments-a-bar/174529 "2006-01-06T13:25:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![binime](https://avatars.discourse-cdn.com/v4/letter/b/278dde/32.png) [@binime](https://forum.kirupa.com/u/binime)\
**Post date:** [January 6, 2006, 1:25pm UTC](https://forum.kirupa.com/t/alternate-button-pressing-increments-a-bar/174529/1 "2006-01-06T13:25:54Z")

</div>

Hey, long time no post.

I have recently started a new project, again and hit a stump. Im trying to make a mini game where you have to press two alternating buttons (x and z) to increment the bar. Now i started it, but it failed as pressing any button really fast incremented the bar. i used a \_root.onEnterFrame = function() {

code, but im having troubles. So what i want to do is have the user press the x button, and then have to press the y button and the bar increases and they have to do this rapidly. If anybody could help i would be very thankful.

–binime–
