# \[Help\] Noob question...manipulate variables from different instances

**URL:** <https://forum.kirupa.com/t/help-noob-question-manipulate-variables-from-different-instances/261676>\
**Category:** Uncategorized\
**Created:** [May 29, 2008, 7:23pm UTC](https://forum.kirupa.com/t/help-noob-question-manipulate-variables-from-different-instances/261676 "2008-05-29T19:23:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vern228](https://avatars.discourse-cdn.com/v4/letter/v/c68b51/32.png) [@Vern228](https://forum.kirupa.com/u/Vern228)\
**Post date:** [May 29, 2008, 7:23pm UTC](https://forum.kirupa.com/t/help-noob-question-manipulate-variables-from-different-instances/261676/1 "2008-05-29T19:23:09Z")

</div>

Hello~!I’m new here and I am self-learning flash…  
I don’t know if I can describe this situation very clearly because I’m poor at English…

Here’s the problem:  
I suppose this action is on the frame:

> var money1:Number = 5000  
> and this is on the button’s action:

> on(release){  
> [COLOR=Red]money1-=100[/COLOR]  
> }  
> What i want to do is when i click the button, the variable money1 (frame’s action) will decrease by 100. Since these actions are on different platform, how do i change the variable money1 from the button’s action?  
> The highlighted statement is absolutely wrong, but still i have to show this problem i faced.

oh btw, I know that these can be solved by using button.onRelease on frame’s action, but I wanna learn how to manipulate variables from different symbol or instance…so, can anyone help me? I’ll be very grateful…

---

<div class="post-metadata">

**Author:** ![cooldude88](https://avatars.discourse-cdn.com/v4/letter/c/e0b2c6/32.png) [@cooldude88](https://forum.kirupa.com/u/cooldude88)\
**Post date:** [May 29, 2008, 7:25pm UTC](https://forum.kirupa.com/t/help-noob-question-manipulate-variables-from-different-instances/261676/2 "2008-05-29T19:25:41Z")

</div>

not a problem here all you have to do is declare your variable like this:  
\_global.money1 = 500;  
that will allow you to use that variable anywhere in your project but you have to call it the same way.  
\_global.money1 -= 100;  
that should solve your problem there good luck.:party:

---

<div class="post-metadata">

**Author:** ![Vern228](https://avatars.discourse-cdn.com/v4/letter/v/c68b51/32.png) [@Vern228](https://forum.kirupa.com/u/Vern228)\
**Post date:** [May 29, 2008, 7:32pm UTC](https://forum.kirupa.com/t/help-noob-question-manipulate-variables-from-different-instances/261676/3 "2008-05-29T19:32:31Z")

</div>

[quote=cooldude88;2333199]not a problem here all you have to do is declare your variable like this:  
\_global.money1 = 500;  
that will allow you to use that variable anywhere in your project but you have to call it the same way.  
\_global.money1 -= 100;  
that should solve your problem there good luck.:party:[/quote]  
Omg, Thanks a lot~~I did it!
