# \[FMX\]problem with integer

**URL:** <https://forum.kirupa.com/t/fmx-problem-with-integer/11862>\
**Category:** flash\
**Created:** [January 23, 2003, 11:46am UTC](https://forum.kirupa.com/t/fmx-problem-with-integer/11862 "2003-01-23T11:46:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![stimulateme](https://avatars.discourse-cdn.com/v4/letter/s/9f8e36/32.png) [@stimulateme](https://forum.kirupa.com/u/stimulateme)\
**Post date:** [January 23, 2003, 11:46am UTC](https://forum.kirupa.com/t/fmx-problem-with-integer/11862/1 "2003-01-23T11:46:31Z")

</div>

Now for some reason im havin a problem with some simple thing. I dont know if ive just overlooked something or what.

## I have this:

total = 500

function bettrue() {  
\_root.total = \_root.total + \_root.betmenu.bet;  
}

## function betfalse() { \_root.total = \_root.total - \_root.betmenu.bet; }

\_root.betmenu.bet is an input text that the user obviously inputs.  
Function betfalse works fine but the problem is in Function bettrue.

If total = 500 and bemenu.bet = 100 I get an answer of 500100. Im just wondering if im using the wrong operator. The thing is that BetFalse works fine. I think Its because the + can also be used to add strings together and is making Bettrue act like string rather than an integer.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 23, 2003, 1:07pm UTC](https://forum.kirupa.com/t/fmx-problem-with-integer/11862/2 "2003-01-23T13:07:00Z")

</div>

You’re absolutely right :cool: You could do something like this:

```auto
a=new String("10");
b=20;
trace (Number(a)+b);

```

pom :asian:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 26, 2003, 10:40am UTC](https://forum.kirupa.com/t/fmx-problem-with-integer/11862/3 "2003-01-26T10:40:46Z")

</div>

thx alot i wasnt sure how to write it  
Also can u declare you varible as integers?
