# If 3 Buttons Clicked - Go To The Next Scene

**URL:** <https://forum.kirupa.com/t/if-3-buttons-clicked-go-to-the-next-scene/324345>\
**Category:** flash\
**Created:** [August 16, 2011, 4:59am UTC](https://forum.kirupa.com/t/if-3-buttons-clicked-go-to-the-next-scene/324345 "2011-08-16T04:59:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![karlgent](https://avatars.discourse-cdn.com/v4/letter/k/a88e4f/32.png) [@karlgent](https://forum.kirupa.com/u/karlgent)\
**Post date:** [August 16, 2011, 4:59am UTC](https://forum.kirupa.com/t/if-3-buttons-clicked-go-to-the-next-scene/324345/1 "2011-08-16T04:59:39Z")

</div>

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:

```auto

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:
