Variable question again

Guys,

Is a variable supposed to work on frames where the MC the variable is declared in, is not on any layer in that frame?

ie.
I have a variable ‘score’ which is declared in MC ‘stats’
MC ‘stats’ is in frame one of layer 1.

On frame 2 layer 2, I have a dynamic txt field ‘score’.
I enter the following script in this frame:


score=_root.stats.score;

The score is not displayed =(
However, it is displayed when I insert a keyframe in layer 1, hence extending it to 2 frames.
But now I have to change the alpha of MC ‘stats’ to 0 in frame 2, because I don’t need it to be shown.

Is there any way I can get the value in ‘score’ without needing to add 1 more frame?

thanks in advance
:asian:

hi thybalt,


score=_root.stats.score;

i donno know why you named the same name SCORE …
and is the score in your code the instance name of the dynamic text or it’s variable name… if it the instance name you have to put .text after score =)

i hope it helps