# Mx 2004 number increment / decrement on button press

**URL:** <https://forum.kirupa.com/t/mx-2004-number-increment-decrement-on-button-press/271334>\
**Category:** Uncategorized\
**Created:** [September 21, 2008, 8:36pm UTC](https://forum.kirupa.com/t/mx-2004-number-increment-decrement-on-button-press/271334 "2008-09-21T20:36:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![michaelruk](https://avatars.discourse-cdn.com/v4/letter/m/c68b51/32.png) [@michaelruk](https://forum.kirupa.com/u/michaelruk)\
**Post date:** [September 21, 2008, 8:36pm UTC](https://forum.kirupa.com/t/mx-2004-number-increment-decrement-on-button-press/271334/1 "2008-09-21T20:36:29Z")

</div>

Hi all, I’ve used the very basics on flash on and off for quite a while such as shape tween, motion tween, layers etc and am wanting to progress things a bit.

I am looking into developing an application that uses code for number increment / decrement upon up and down button click.  
I’ve had a look around the web and for tutorials, especially on flash kit tutorial site and searching but don’t seem to find quite what I require.

One example is as follows [http://www.crickweb.co.uk/assets/res…hp?&file=fmach](http://www.crickweb.co.uk/assets/resources/flash.php?&file=fmach)

Perhaps a better example is [http://www.numbergym.co.uk/NP13swf/N…tionsExpl.html](http://www.numbergym.co.uk/NP13swf/NG_FractionsExpl.html)  
which takes things to the next level which I’m also looking to do so that you can click up or down, the number increment / decrements and there is also a visual indication of the count as well (like building blocks).

I have an idea that the the bit displaying the current number possibly uses a dynamic text box.The initial number may be stored within a variable and then for up or down the action script code is along the lines of variable = variable +1 and variable = variable - 1 for minus etc? Can anyone offer any help on how to achieve this for both code and upon button press?

Also I’m not sure exactly how the blocks being added / removed is linked to the increase / decrease of the number being chosen or the code itself. Does anyone know of tutorials which may give me some insight into this please?

Thanks for any help,  
Michael
