PDA

View Full Version : attach movie, levels and vars



mojoNYC
February 27th, 2003, 02:07 PM
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

RvGaTe
February 27th, 2003, 04:31 PM
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 :)

mojoNYC
February 27th, 2003, 05:09 PM
right on! thanks RvGaTe (how do you say that?) :goatee:
-mojo

RvGaTe
February 27th, 2003, 05:10 PM
Are Vee Gayt :P

hehe

mojoNYC
February 27th, 2003, 10:20 PM
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?

RvGaTe
February 28th, 2003, 01:11 PM
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);