If 3 Buttons Clicked - Go To The Next Scene

Hi all,

Am in desperate need for some quick help please. I have a game where there are five buttons which can be clicked (which will play sounds). But once 3 of them have been clicked, the user is taken to a new scene.

I have the following code, but since I’m new to ActionScript, I’m completely lost why this isn’t working:


var buttonArr:Array = new Array (button1, button2, button3, button4, button5);


var t: int = 0;     


function clickCounter (event:MouseEvent ){
    var target = buttonArr;
    target.MouseEvent.CLICK = t++;
    
    if ( t > 2 ){
        
        gotoAndStop("1","scene2");
    }
}

Can someone please offer some advice to make the game go to a new scene once 3 buttons are clicked?

Thanks very much :cowboy: