# AS3 Math problem

**URL:** <https://forum.kirupa.com/t/as3-math-problem/323052>\
**Category:** flash\
**Created:** [June 15, 2011, 8:40am UTC](https://forum.kirupa.com/t/as3-math-problem/323052 "2011-06-15T08:40:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Roarky](https://avatars.discourse-cdn.com/v4/letter/r/d6d6ee/32.png) [@Roarky](https://forum.kirupa.com/u/Roarky)\
**Post date:** [June 15, 2011, 8:40am UTC](https://forum.kirupa.com/t/as3-math-problem/323052/1 "2011-06-15T08:40:21Z")

</div>

Hi guys, I’m new to this forum and I might say, this forum looks great…  
I am not really familiar in the mathematical here in AS3, I want to make a calculator with fixed number to add to an input text field…

Here is what I got so far:  
invest\_btn.addEventListener(MouseEvent.CLICK,investClick);

numA.restrict = “0-9’”;  
var input1:String;  
var totalRes:Number;  
var input2 = 10;

function investClick(event:MouseEvent):void{  
totalRes = parseInt(input1) + Number(input2);  
totalRes.toString();  
total\_txt.text = String(totalRes);  
}

I got an input text field called numA and a dynamic text field called total\_txt…  
Just want to add whatever people input in the input field with 10, keep getting NaN as a result…

Thx guys for the help…
