# \[F5\] global - just whats going on!

**URL:** https://forum.kirupa.com/t/f5-global-just-whats-going-on/14313
**Category:** flash
**Created:** [February 24, 2003, 10:49pm UTC](https://forum.kirupa.com/t/f5-global-just-whats-going-on/14313 "2003-02-24T22:49:55Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![rainbowpants](https://avatars.discourse-cdn.com/v4/letter/r/a88e4f/32.png) [@rainbowpants](https://forum.kirupa.com/u/rainbowpants)
#### Post date: [February 24, 2003, 10:49pm UTC](https://forum.kirupa.com/t/f5-global-just-whats-going-on/14313/1 "2003-02-24T22:49:55Z")

</div>

Hi, im trying to use the global variable declaration. I searched through some of the other threads and found some asking the same things, but doing what they say i still couldn’t get it to work. Up to know i’ve been using the x coordinate of a movie clip to pass variables between different movies, and i thought it was time to learn properly! Just to get it to work, im trying a flash file with two movies in the root. one movie defines a glabal variable on load;

\_global.numb = 6;

and then im trying to just get the other to trace it on enter frame, so the code attatched to the other movie (on enterframe) is…

trace(numb);

(and i tried trace(\_global.numb) as well, but i was under the impression that you only had to define it as being a property once.). All that happens when i run the movie is nothing is traced.

Im not too hot at flash, so i might be doing something really stupid, but i’d really appreciate if anyone could help. Thanks very much.

:phil:

woah! that smiley is wkd smart!

nic.

---

<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: [February 24, 2003, 11:01pm UTC](https://forum.kirupa.com/t/f5-global-just-whats-going-on/14313/2 "2003-02-24T23:01:13Z")

</div>

\_global has been introdiced with Flash MX :beam:

---

<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: [February 24, 2003, 11:04pm UTC](https://forum.kirupa.com/t/f5-global-just-whats-going-on/14313/3 "2003-02-24T23:04:05Z")

</div>

Arg… I’m late… :skull:

Yup… global can be used only in FMX…

If you were to do it in F5, you can just create bunch of variables in the main timeline and use it like that…

\_root.numb = 6;  
trace(\_root.numb);

---

<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: [February 24, 2003, 11:08pm UTC](https://forum.kirupa.com/t/f5-global-just-whats-going-on/14313/4 "2003-02-24T23:08:41Z")

</div>

dudes! thanks so much. The best response possible - its not that _you_ can’t do it, its just that it cant be done!

thanksq very much - everythings fallen into place. :beam:

---

<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: [February 24, 2003, 11:09pm UTC](https://forum.kirupa.com/t/f5-global-just-whats-going-on/14313/5 "2003-02-24T23:09:33Z")

</div>

The closest thing to this in Flash 5 would be to put the references inside objects that you can access anywhere, for instance a constructor. The Object class constructor, for instance.

Object.numb=6;

---

<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: [February 24, 2003, 11:49pm UTC](https://forum.kirupa.com/t/f5-global-just-whats-going-on/14313/6 "2003-02-24T23:49:47Z")

</div>

Yes… Object… Right… That might be closer than using \_root… But then, what is object??? Stop confusing me… :evil: :beam:

---

<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: [February 24, 2003, 11:57pm UTC](https://forum.kirupa.com/t/f5-global-just-whats-going-on/14313/7 "2003-02-24T23:57:24Z")

</div>

Well, it’s supposed to be the Object class constructor. I’ve never actually tried this, but it should work :sigh: maybe…  
It can be any class, really. It’s just that Object is the most basic one.

---

<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: [February 24, 2003, 11:59pm UTC](https://forum.kirupa.com/t/f5-global-just-whats-going-on/14313/8 "2003-02-24T23:59:44Z")

</div>

Yes… That should work perfectly… I remember that I had an object which contains all the viable variables that I was dealing with for the project… :cowboy:

---

<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: [February 25, 2003, 12:17am UTC](https://forum.kirupa.com/t/f5-global-just-whats-going-on/14313/9 "2003-02-25T00:17:13Z")

</div>

oooh, thanks, i’ll have to try that. So whats the deal with the \_root.varname then? is that ok? I’ve tried using that and it seemed to work. Where/would that break down?

:crazy:

■■■■! these are some good smileys!

thanksq

nic.

---

<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: [February 25, 2003, 12:34am UTC](https://forum.kirupa.com/t/f5-global-just-whats-going-on/14313/10 "2003-02-25T00:34:59Z")

</div>

Oh… That \_root.varName should work perfectly…

I was just trying to tell you the easy way to do it and ilyaslamasse was trying to tell you the most similar thing in F5 to \_global since \_global didn’t exist in F5…

---

<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: [February 26, 2003, 12:08am UTC](https://forum.kirupa.com/t/f5-global-just-whats-going-on/14313/11 "2003-02-26T00:08:37Z")

</div>

cool, i see. thanks very much for your help

---

<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: [February 26, 2003, 2:23am UTC](https://forum.kirupa.com/t/f5-global-just-whats-going-on/14313/12 "2003-02-26T02:23:14Z")

</div>

No problem… :rambo:
