Calling a variable inside a movieClip.
Hi. I'm having problems in calling my variable score which I assigned inside a movieClip. What I want to happen is when my score reaches my desired value(e.g. 10), I want the congratulations screen to be visible. The congratulations screen is placed in the main timeline. Is there a way I can access the variable that I created inside a movieClip?
I tried using:
if (score == 10)
{
MovieClip(root).screen_1.visible = true;
}
// this code snippet is placed inside the movieClip where the variable score is declared. But it doesn't seem to work.
I also tried:
if (MovieClip(root).score == 1)
{
screen_1.visible = true;
}
//this code snippet is placed in the main timeline. It also didn't work. I didn't get any errors in this codes but it doesn't give me the result that I wanted. Thank you.
