# Multiple Button Array help! AS2.0

**URL:** https://forum.kirupa.com/t/multiple-button-array-help-as2-0/327515
**Category:** Uncategorized
**Created:** [March 6, 2012, 5:03pm UTC](https://forum.kirupa.com/t/multiple-button-array-help-as2-0/327515 "2012-03-06T17:03:35Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Venturi01](https://avatars.discourse-cdn.com/v4/letter/v/ee59a6/32.png) [@Venturi01](https://forum.kirupa.com/u/Venturi01)
#### Post date: [March 6, 2012, 5:03pm UTC](https://forum.kirupa.com/t/multiple-button-array-help-as2-0/327515/1 "2012-03-06T17:03:35Z")

</div>

I need some help with code. I can read code, but i am not at a level where i can freely write it. I have 3 buttons, each one goes to a frame lable. After all 3 buttons are clicked, a get url command is executed. How would i do this if i have 10 or more buttons, i am looking at arrays, I found one thread that helped me understand it better, but its in 3.0…my project is 2.0.

This is what i have so far.

var count:Number = 0  
var btn1:Boolean = false;  
var btn2:Boolean = false;  
var btn3:Boolean = false;

b1\_btn.onRelease = function()  
{  
if(btn1 == false){  
btn1 = true;  
count++;  
}  
if(count == 3){  
getURL(“javascript:button78.actionShow();”);;  
}  
}

b2\_btn.onRelease = function()  
{  
if(btn2 == false){  
btn2 = true;  
count++;  
}  
if(count == 3){  
getURL(“javascript:button78.actionShow();”);;  
}  
}

b3\_btn.onRelease = function()  
{  
if(btn3 == false){  
btn3 = true;  
count++;  
}  
if(count == 3){  
getURL(“javascript:button78.actionShow();”);;  
}  
}

If i have 10 or more buttons, how can this code be streamlined to where all i have to do is change a variable when i add more buttons to the scene. I can see it in my head, i just cant get the syntax right.
