# Number variable in text field

**URL:** <https://forum.kirupa.com/t/number-variable-in-text-field/245760>\
**Category:** flash\
**Created:** [December 3, 2007, 7:08pm UTC](https://forum.kirupa.com/t/number-variable-in-text-field/245760 "2007-12-03T19:08:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![alemieux34](https://avatars.discourse-cdn.com/v4/letter/a/7ea924/32.png) [@alemieux34](https://forum.kirupa.com/u/alemieux34)\
**Post date:** [December 3, 2007, 7:08pm UTC](https://forum.kirupa.com/t/number-variable-in-text-field/245760/1 "2007-12-03T19:08:51Z")

</div>

I am making a game in Flash and I’m trying to increment the score for each alien that’s killed in the game. There is a score variable that’s created on the main timeline:

```auto
var score:int;
score = 0;

```

Then, inside the alien movie clip, I want to record the score and give it a value each time the user hits the alien and then show the score in a dynamic text field called score\_txt. So in the function that tracks the death of an alien, here’s what I have:

```auto
root.score_txt.text = root.score 

```

I keep getting error messages. Any clues?
