# Global variables

**URL:** <https://forum.kirupa.com/t/global-variables/17271>\
**Category:** flash\
**Created:** [April 3, 2003, 8:47am UTC](https://forum.kirupa.com/t/global-variables/17271 "2003-04-03T08:47:16Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![zangorn](https://avatars.discourse-cdn.com/v4/letter/z/bbe5ce/32.png) [@zangorn](https://forum.kirupa.com/u/zangorn)\
**Post date:** [April 3, 2003, 8:47am UTC](https://forum.kirupa.com/t/global-variables/17271/1 "2003-04-03T08:47:16Z")

</div>

Global variables dont seem to work for my application. Am I doing something wrong? If yes, what would you recommend?

I have onEnterFrame functions in the \_root and in a symbol. I want to pass data back and forth between the two functions. How can I do this?  
thanks a lot!!  
-Parker

---

<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:** [April 3, 2003, 2:20pm UTC](https://forum.kirupa.com/t/global-variables/17271/2 "2003-04-03T14:20:55Z")

</div>

Just have a variable being called inside of the movie… and then call the variable like this \_root.variable = 0;

Anywhere in the movie… That way it knows where the variable will be located at.

playamarz 🙂

---

<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:** [April 3, 2003, 2:29pm UTC](https://forum.kirupa.com/t/global-variables/17271/3 "2003-04-03T14:29:03Z")

</div>

[http://www.kirupaforum.com/forums/showthread.php?s=&threadid=17389](http://www.kirupaforum.com/forums/showthread.php?s=&threadid=17389) =)

---

<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:** [April 3, 2003, 2:32pm UTC](https://forum.kirupa.com/t/global-variables/17271/4 "2003-04-03T14:32:47Z")

</div>

playa, you can set global variables too.

it is something like this (At least concearning the flash 5 version(don´t now if it changed in FMX)):

Global variables are variables that can be set or retrieved at any point anywere.

[AS]Object.prototype.yourGlobalVariable = value;[/AS]

---

<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:** [April 3, 2003, 2:34pm UTC](https://forum.kirupa.com/t/global-variables/17271/5 "2003-04-03T14:34:46Z")

</div>

_blink_… Hmm… _lol_ Cool

playamarz :cool:

---

<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:** [April 3, 2003, 2:36pm UTC](https://forum.kirupa.com/t/global-variables/17271/6 "2003-04-03T14:36:42Z")

</div>

damm you kax! i didn´t see your post!!!

i got another link, but sen´s explanation is way better 😉

[http://www.kirupaforum.com/forums/showthread.php?s=&threadid=10061&highlight=global+variables](http://www.kirupaforum.com/forums/showthread.php?s=&threadid=10061&highlight=global+variables)

still love you anyways kax :love:

---

<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:** [April 3, 2003, 2:42pm UTC](https://forum.kirupa.com/t/global-variables/17271/7 "2003-04-03T14:42:28Z")

</div>

> _Originally posted by Guig0_  
> **damm you kax! i didn´t see your post!!!**

☹

> _Originally posted by Guig0_  
> **i got another link, but sen´s explanation is way better 😉**

:sigh:

> _Originally posted by Guig0_  
> **still love you anyways kax :love:**

:love: =)

😛 😛 😛  
[size=1]a smilie is worth more than a thousand words… ;)[/size]
