# \[Flash 8\]: Help with variables for score counting

**URL:** <https://forum.kirupa.com/t/flash-8-help-with-variables-for-score-counting/170262>\
**Category:** Uncategorized\
**Created:** [November 24, 2005, 5:39am UTC](https://forum.kirupa.com/t/flash-8-help-with-variables-for-score-counting/170262 "2005-11-24T05:39:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tjonmage](https://avatars.discourse-cdn.com/v4/letter/t/51bf81/32.png) [@tjonmage](https://forum.kirupa.com/u/tjonmage)\
**Post date:** [November 24, 2005, 5:39am UTC](https://forum.kirupa.com/t/flash-8-help-with-variables-for-score-counting/170262/1 "2005-11-24T05:39:45Z")

</div>

I am creating a simple game where you must remember the name of a number of people. On the stage is a table with faces. Text appears, asking who, for example, “Mike” is. You then have to click the correct face. The questions appear randomly.

I have come this far, but what I want to do is the following:

1. Restrict the number of random questions, presumably by adding a variable, with the value incrementing by each question, and tells the movie clip to go to the “game results” frame when reaching a certain number.

2. Keep track of the number of questions answered correctly/incorrectly. I suppose this is also done easily by adding a value for number of incorrect answers, which is increased for each incorrect answer, with the amount of correct answers being calculated like (total number of questions)-(incorrect answers).

3. Display the number of correct and incorrect questions on the “game results” frame. For example “You answered X number of questions correctly, and Z number of questions incorrectly”.

I know that the pieces of code below should be used, but I don`t know how to put it all together, or where to put it. I suppose the main code should be in the first frame, and some should be in the buttons.

```auto
var questionsAsked:Number;

```

```auto
myValue++;

```

```auto
 if (questionsAsked == 20){ 
gotoAndStop("results");
}

```

It would be great if I could get help with this.
