resetting vars with button actions

I have three MCs and three buttons. The MCs have four frames each. I want the mouse overs to make each clip advance one frame to 2 and stay. If they click, I want it to go to frame 3. If they mouse out and then mouse over again, I want it to stay on frame 3. I wanted to use the following code to advance one frame only if it was the first mouse over. It doesn’t work.

This is the code for one button…

var correct = 0;
var wronga =0;
var checka =0;
var wrongb =0;
var checkb =0;

correct_btn1.addEventListener(MouseEvent.MOUSE_OVER, pop1);

function pop1(event: MouseEvent): void {
correct ++;
if (correct ==1){
correct_btn1.addEventListener(MouseEvent.MOUSE_DOWN, correct1);

function correct1(event: MouseEvent): void {
correct = 1;
if (correct ==1){
correct_btn1.addEventListener(MouseEvent.MOUSE_OUT, out1);

function out1(event: MouseEvent): void {
correct = 0;
checka = 0;
wronga = 0;
checkb = 0;
wrongb = 0;

Thanks in advance!

By the way, the “correct = 1;
if (correct ==1)” part is fixed.

Put more simply,

var starts at 0
mouse over sets it to 1 (++)
mouse out sets it back to 0 (= 0)
2nd mouse over sees that the var is 0, sets it back to 1