# Variable help

**URL:** <https://forum.kirupa.com/t/variable-help/319278>\
**Category:** Uncategorized\
**Created:** [February 15, 2011, 8:35am UTC](https://forum.kirupa.com/t/variable-help/319278 "2011-02-15T08:35:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![theclaw](https://avatars.discourse-cdn.com/v4/letter/t/779978/32.png) [@theclaw](https://forum.kirupa.com/u/theclaw)\
**Post date:** [February 15, 2011, 8:35am UTC](https://forum.kirupa.com/t/variable-help/319278/1 "2011-02-15T08:35:31Z")

</div>

heey long time viewer first time poster here, so ill just go right in to it  
im trying to use this variable inside a movie clip if that is even possible… trying to make a money system for a game, maybe im just going at it all wrong any one got any tips? or maybe you know of some tutorials on variables i have googled it but have found nothing to helpful (im using macromedia flash pro 8)

the variable is:

cash = “0”;  
\_root.cash -= 0;

then a few buttons

button1 adds  
on (release) {cash +=20;}

button2 subtract  
on (release) {cash -=20;}

and button3 is a buy button  
on (release) {  
if (cash\>49) {  
\_root.cash-=50;  
}  
}

this code works fine until you put it in a movie clip here is a link to the fla [http://theclaw.fileave.com/moneyinmc.fla](http://theclaw.fileave.com/moneyinmc.fla)

oh and btw! how can i make buttons disappear after use? thx for taking the time to help me out and the tips are greatly appreciated!
