# Variables

**URL:** <https://forum.kirupa.com/t/variables/96917>\
**Category:** Uncategorized\
**Created:** [December 15, 2003, 1:21pm UTC](https://forum.kirupa.com/t/variables/96917 "2003-12-15T13:21:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lucremonkey](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/lucremonkey/32/374_2.png) [@Lucremonkey](https://forum.kirupa.com/u/Lucremonkey)\
**Post date:** [December 15, 2003, 1:21pm UTC](https://forum.kirupa.com/t/variables/96917/1 "2003-12-15T13:21:18Z")

</div>

Hey,  
I have made a shoppingcart in FlashMX, but I’m encountering some problems…

I have 4 textfield (dynamic).

- Total Items
- Total Price
- Total Discount
- Total

The first on displays the number of items  
The second one the total price  
The third one the total discount  
The fourth one should display:

Total Price - Total Discount

I gave the textfields Instance names and variable names and for input in the shop I use the combobox component Flash has (named Banditbox and banditbox2).  
I want the following thing to happen:  
When I press a button, I want the script to do:

Total Items + Banditbox  
Total Price + 399  
Total discount + 100  
Total = Total Price - Total Discount

I’ve tried loads of stuff (using global variables and textbox variables, but I can’t get it working :()

Could anyone help me out?

Here is the source:  
[http://oege.ie.hva.nl/~groot7n/Layout.zip](http://oege.ie.hva.nl/~groot7n/Layout.zip)

(other hints, tips also welcome)  
P.S. I think I want to use global variables since the can be accessed from anywhere  
P.P.S. I know this should be easy stuff, but I can’t seem to solve it 😃
