# Change a variable value from an .as file

**URL:** <https://forum.kirupa.com/t/change-a-variable-value-from-an-as-file/215595>\
**Category:** flash\
**Created:** [February 8, 2007, 2:47pm UTC](https://forum.kirupa.com/t/change-a-variable-value-from-an-as-file/215595 "2007-02-08T14:47:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gloqui](https://avatars.discourse-cdn.com/v4/letter/g/97f17d/32.png) [@gloqui](https://forum.kirupa.com/u/gloqui)\
**Post date:** [February 8, 2007, 2:47pm UTC](https://forum.kirupa.com/t/change-a-variable-value-from-an-as-file/215595/1 "2007-02-08T14:47:37Z")

</div>

Hi everybody!

I have this problem that I don’t know how to resolve. I have a variable on .as file, that it has a value of 0 (i.e. rightanswered = 0). In the same .as file, I have another variable that adds that value to a piece of text (i.e. finalscore = "Your score is " + rightanswered). Then, on the main swf, I change the variable value, to, for example, 6. The problem is that when I trace the variable (rightanswered)the value does change, but when I display on an dynamic text field (i.e. displaytxt.text = \_root.finalscore), it shows me the value that is stored on the .as file (in this case, it shows me “Your score is 0” instead of “Your score is 6”). What am I doing wrong? Please someone help me with this issue.
