# On button click how to increase the numbers

**URL:** https://forum.kirupa.com/t/on-button-click-how-to-increase-the-numbers/295030
**Category:** flash
**Created:** [August 24, 2009, 3:01pm UTC](https://forum.kirupa.com/t/on-button-click-how-to-increase-the-numbers/295030 "2009-08-24T15:01:01Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Luks](https://avatars.discourse-cdn.com/v4/letter/l/f14d63/32.png) [@Luks](https://forum.kirupa.com/u/Luks)
#### Post date: [August 24, 2009, 3:01pm UTC](https://forum.kirupa.com/t/on-button-click-how-to-increase-the-numbers/295030/1 "2009-08-24T15:01:01Z")

</div>

Hi,  
I have 3 buttons. When i click on the button1 i wish to increase the number to 1, when i click button 2 i wish to increase number to 2 and when i click on button 3 i wish to increase to 3…so it must increasing 1,2,3… But the problem is, when i click on the first button back twice i wish not to show me the number 1, but i wish to disable the counting because we have already click on this button. I dont need the this.enabled = false; code but something count == 0, but is not working.

stop();  
button.onRelease = function(){  
var count:Number = 0;  
count++;  
counter.text = count;  
}  
button2.onRelease = function(){  
var count:Number = 1;  
count++;  
counter.text = count;  
}  
button3.onRelease = function(){  
var count:Number = 2;  
count++;  
counter.text = count;  
}

Please help if anyone know how to do this

Luka
