# Attach movie, levels and vars

**URL:** <https://forum.kirupa.com/t/attach-movie-levels-and-vars/14557>\
**Category:** Uncategorized\
**Created:** [February 27, 2003, 7:07pm UTC](https://forum.kirupa.com/t/attach-movie-levels-and-vars/14557 "2003-02-27T19:07:11Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mojoNYC](https://avatars.discourse-cdn.com/v4/letter/m/b5a626/32.png) [@mojoNYC](https://forum.kirupa.com/u/mojoNYC)\
**Post date:** [February 27, 2003, 7:07pm UTC](https://forum.kirupa.com/t/attach-movie-levels-and-vars/14557/1 "2003-02-27T19:07:11Z")

</div>

i’ve got a movie where i’m attaching a MC and trying to get a variable from the main movie–i can’t seem to pick up a variable from the main movie using ‘myVar=\_root.myVar’ or ‘myVar=\_level0.myVar’ inside the MC–any ideas on what i’m missing here?  
thx,  
-mojo

---

<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 27, 2003, 9:31pm UTC](https://forum.kirupa.com/t/attach-movie-levels-and-vars/14557/2 "2003-02-27T21:31:28Z")

</div>

try to declare your vars with \_global, like this:

\_global.myvar = value

then you can easily use this var inside every scene and symbol using simply the varname itself, like:

myvar

… easy as that, and it works 🙂

---

<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 27, 2003, 10:09pm UTC](https://forum.kirupa.com/t/attach-movie-levels-and-vars/14557/3 "2003-02-27T22:09:19Z")

</div>

right on! thanks RvGaTe (how do you say that?) :goatee:  
-mojo

---

<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 27, 2003, 10:10pm UTC](https://forum.kirupa.com/t/attach-movie-levels-and-vars/14557/4 "2003-02-27T22:10:24Z")

</div>

Are Vee Gayt 😛

hehe

---

<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 28, 2003, 3:20am UTC](https://forum.kirupa.com/t/attach-movie-levels-and-vars/14557/5 "2003-02-28T03:20:20Z")

</div>

Rv-  
i put this var on the main timeline:  
\_global.hex2 =“ffffff”;

and this in my MC:  
trace(\_global.hex1);

it came up undefined–what am i missing?

---

<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 28, 2003, 6:11pm UTC](https://forum.kirupa.com/t/attach-movie-levels-and-vars/14557/6 "2003-02-28T18:11:16Z")

</div>

try tracing “hex2” enstead of 1, coz you declare the var with “hex2”

## declare with

\_global.hex2=“FFFFFF”

## and trace with

trace(\_global.hex2);  
or  
trace(hex2);
