# onChange won't update

**URL:** https://forum.kirupa.com/t/onchange-wont-update/192603
**Category:** flash
**Created:** [June 29, 2006, 6:16pm UTC](https://forum.kirupa.com/t/onchange-wont-update/192603 "2006-06-29T18:16:25Z")
**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: [June 29, 2006, 6:16pm UTC](https://forum.kirupa.com/t/onchange-wont-update/192603/1 "2006-06-29T18:16:25Z")

</div>

I’m using the following script to try to add together a set of scores as soon as they change in input text fields.

```auto
var score1:Number = 2;
var score2:Number = 3;
var score3:Number = 4;
var score4:Number = 5;
var score5:Number = 6;
var score6:Number = 2;
var score7:Number = 1;
var total:Number = score1 + score2 + score3 + score4 + score5 + score6 + score7;

score1_txt.onChanged = function() {
    if (score1_txt.text > 5) {
        trace("I'm sorry, you can only enter a number between 1 and 5");
    }
    total_txt.text = total;
}

```

The value won’t update. If I put total\_txt.text = score1 + total, it just concatenates the value of score1 to the end of total.

I read somewhere that adding an eventListener would help, but in this case there’s only 1 textField called total that needs to be updated. What can I do?
