|
-
Designer, Programmer, Musician
[RESOLVED] Variable addition from input textbox
Hello guys,
I've tried a lot of things and i don't manage to do this. I'm have this soda machine, that you have to enter some numbers like cents to buy soda (i think fruitbeard or Nig13 helped with that once, not sure).
I have 3 textboxes, an input TB (there you enter your money), and 2 dynamic TB, one for monitoring the addition and one to show the money that rests in your wallet.
The first dynamic TB has $2.50 (buy i'm not using decimals, it only says 250)
The thing is, when you type let's say 10 on the input TB, the dynamic TB increase that number. myDynamicTB-=myTextBox.text. That works great. The myDynamicTB shows 240, the result of substracting 10 to 250.
But now i need to add the myTextBox entered value to be shown in the monitoring textbox with variable name myMonitor. I tried myMonitor += myTextBox.text that should work, but it doesn't. Instead of additing 10+10 =20, it shows this on the myMonitor textbox 1010. I tried myMonitor = myTextBox.text+myTextBox.text; i tried triggering the myText value to another numeric variable, but everything i try, instead of showing 20, that is the addition of 10+10 when you type 10 and then type 10 again, it shows 1010.
I know it's easy to do this but i'm new substracting and additing variables. Thanks in advance!
Last edited by angelhdz; 11-28-2012 at 05:51 PM.
 Already mastering AS3. It was so fun. Now into Javascript and PHP and all its libraries 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|