# Number Controller Problem

**URL:** <https://forum.kirupa.com/t/number-controller-problem/214563>\
**Category:** flash\
**Created:** [January 30, 2007, 4:39am UTC](https://forum.kirupa.com/t/number-controller-problem/214563 "2007-01-30T04:39:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tyg3r](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/tyg3r/32/1341_2.png) [@Tyg3r](https://forum.kirupa.com/u/Tyg3r)\
**Post date:** [January 30, 2007, 4:39am UTC](https://forum.kirupa.com/t/number-controller-problem/214563/1 "2007-01-30T04:39:05Z")

</div>

Hey

I’m trying to make a little controller that will increase and decrease the digits within a dynamic text box. The subtract button works fine. It’s just the addition button which is causing me problems.

Instead of increasing the digit by one… its adding a one to the end of the dynamic text field.

Here’s a mock up of what I’m trying to do:

[AS]number\_text.onChanged = function() {  
this.restrict = “0-9”;  
};  
number\_text.onChanged();  
//  
right\_btn.onPress = function() {  
if ((number\_text.text\<=100) && (number\_text.length\<=3) && (number\_text.text !== “”)) {  
number\_text.text = number\_text.text+1;  
}  
};  
//  
left\_btn.onPress = function() {  
if ((number\_text.text\>=1) && (number\_text.text !== “”)) {  
number\_text.text = number\_text.text-1;  
}  
};  
[/AS]
