# Need help on scoring

**URL:** <https://forum.kirupa.com/t/need-help-on-scoring/66131>\
**Category:** flash\
**Created:** [October 3, 2004, 1:15am UTC](https://forum.kirupa.com/t/need-help-on-scoring/66131 "2004-10-03T01:15:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![DarkDragoonZ](https://avatars.discourse-cdn.com/v4/letter/d/258eb7/32.png) [@DarkDragoonZ](https://forum.kirupa.com/u/DarkDragoonZ)\
**Post date:** [October 3, 2004, 1:15am UTC](https://forum.kirupa.com/t/need-help-on-scoring/66131/1 "2004-10-03T01:15:20Z")

</div>

[font=Comic Sans MS]I need help on my flash game. I’m making a clicking game. But when i click on a button it says NAN. This is what i typed on the button.[/font]

```auto
 
on (release) {
 _root.total = _root.total + 15;
}

```

Some one help plz.

---

<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:** [October 3, 2004, 1:30am UTC](https://forum.kirupa.com/t/need-help-on-scoring/66131/2 "2004-10-03T01:30:07Z")

</div>

Is “\_root.total” originally set to zero, like at the start screen. That may be your problem.

---

<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:** [October 3, 2004, 1:33am UTC](https://forum.kirupa.com/t/need-help-on-scoring/66131/3 "2004-10-03T01:33:34Z")

</div>

> [@superdiscopirat](#):
>
> Is “\_root.total” originally set to zero, like at the start screen. That may be your problem.

Yup, most likely your problem.

total = 0;

make sure you define your variables before using them.

---

<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:** [October 3, 2004, 4:00am UTC](https://forum.kirupa.com/t/need-help-on-scoring/66131/4 "2004-10-03T04:00:04Z")

</div>

but now it only goes up to 15…

---

<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:** [October 3, 2004, 5:10am UTC](https://forum.kirupa.com/t/need-help-on-scoring/66131/5 "2004-10-03T05:10:40Z")

</div>

Sounds like a personal problem.

But no, really, it’s probably only going up to 15 because it keeps getting reset to 0 every time flash reads the frame that has total = 0; on it.
