How to pass variables values from movie clips to the main stage

Hi all,

Newbie here. I have been studying up a storm but the learning curve is steep.

I’m perplexed by passing variables from a movie clip to the main stage.

I have a movie clip with an instance name mc1 on the main stage. In that movie clip I declared a variable

c = 5;

on the first frame inside the mc1 movie clip.

I thought I could access that variable inside mc1 from the main stage by placing this on the first frame of the main stage:

x = _root.mc1.c;

Obviously I don’t understand what is going on in terms of scope of variables because I keep getting an undefined statement in my variable x.

Some insight would be appreciated.


Thanks,
Greg