# Keeping Score Tutorial

**URL:** <https://forum.kirupa.com/t/keeping-score-tutorial/265739>\
**Category:** flash\
**Created:** [July 11, 2008, 7:37pm UTC](https://forum.kirupa.com/t/keeping-score-tutorial/265739 "2008-07-11T19:37:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pandalu](https://avatars.discourse-cdn.com/v4/letter/p/ea666f/32.png) [@Pandalu](https://forum.kirupa.com/u/Pandalu)\
**Post date:** [July 11, 2008, 7:37pm UTC](https://forum.kirupa.com/t/keeping-score-tutorial/265739/1 "2008-07-11T19:37:41Z")

</div>

I have done the Keeping Score tutorial here  
[http://www.kirupa.com/developer/mx/score.htm](http://www.kirupa.com/developer/mx/score.htm)

It allows me to have two buttons, one will decrease the score, and one will increase.

I have followed it step by step and i am running into problems.

The decrease works fine, and it takes away 100 from the score. Great. Yet i press the increase button, and it will add 100 onto the number literally.

For example:  
The score at the start is 0. I click the increase button and it turns into 0100. And keeps adding 100 onto the number.

However, if i press the decrease button first, and then press the increase button,it will work perfectly fine.

I am VERY confused!

---

<div class="post-metadata">

**Author:** ![krilnon](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/krilnon/32/34_2.png) [@krilnon](https://forum.kirupa.com/u/krilnon)\
**Post date:** [July 11, 2008, 9:51pm UTC](https://forum.kirupa.com/t/keeping-score-tutorial/265739/2 "2008-07-11T21:51:24Z")

</div>

I think that you just need to initialize the `total` variable as a number. The tutorial was originally written for Flash MX, a version of Flash in which automatic variable initialization was a bit different.

For example, to make the tutorial FLA work when publishing for Flash 8, I added the following line to the main timeline:

```auto
total = 0;

```
