# Global Variables/functions

**URL:** https://forum.kirupa.com/t/global-variables-functions/1675
**Category:** flash
**Created:** [June 10, 2002, 5:41pm UTC](https://forum.kirupa.com/t/global-variables-functions/1675 "2002-06-10T17:41:23Z")
**Posts on this page:** 5
**Page:** 1

<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: [June 10, 2002, 5:41pm UTC](https://forum.kirupa.com/t/global-variables-functions/1675/1 "2002-06-10T17:41:23Z")

</div>

in the main timeline of the original movie I have a function\r\r\_global.nVidRob = function(){\rthen some crap in here\r}\r\rthen on a button in a SWF that is loaded in after the main movie is up and running I have\r\ron(press){\r\_global.nVidRob()\r}\r\ror \r\ron(press){\rnVidRob()\r}\r\rit works if i put the function in the SWF, but I can’t really do that in this case…any ideas on why thats not workin…

---

<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: [June 10, 2002, 10:14pm UTC](https://forum.kirupa.com/t/global-variables-functions/1675/2 "2002-06-10T22:14:36Z")

</div>

Maybe when you compile the darn thing Flash doesn’t recognize the function ? So when you load, it cannot interpret it correctly ?\r\rpom 0] , I should really be going 🙂

---

<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: [June 11, 2002, 3:07am UTC](https://forum.kirupa.com/t/global-variables-functions/1675/3 "2002-06-11T03:07:12Z")

</div>

thats probly it, but i assumed that global meant, it could be used over all loaded SWFs as well. Oh, well…back to the drawing board…

---

<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: [June 12, 2002, 1:34am UTC](https://forum.kirupa.com/t/global-variables-functions/1675/4 "2002-06-12T01:34:43Z")

</div>

Jubba, which you are not…\r\rI believe it wont work because \_global is a unique reference to each swf’s main timeline.\r\rNow, perhaps I am wrong but…\r\rHave you tried setting your function on the main timeline and then loading the variables from your swf? I know it is kind of a weird way, but maybe… just maybe…\r

---

<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: [June 12, 2002, 2:50am UTC](https://forum.kirupa.com/t/global-variables-functions/1675/5 "2002-06-12T02:50:14Z")

</div>

I haven’t tried that, but I do believe you are right about the main timeline thing…
