# Variable question again

**URL:** <https://forum.kirupa.com/t/variable-question-again/12730>\
**Category:** Uncategorized\
**Created:** [February 4, 2003, 2:05am UTC](https://forum.kirupa.com/t/variable-question-again/12730 "2003-02-04T02:05:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![thybalt](https://avatars.discourse-cdn.com/v4/letter/t/e5b9ba/32.png) [@thybalt](https://forum.kirupa.com/u/thybalt)\
**Post date:** [February 4, 2003, 2:05am UTC](https://forum.kirupa.com/t/variable-question-again/12730/1 "2003-02-04T02:05:44Z")

</div>

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:

---

<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 4, 2003, 12:36pm UTC](https://forum.kirupa.com/t/variable-question-again/12730/2 "2003-02-04T12:36:35Z")

</div>

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
