Alternate Button pressing increments a bar

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–