# Can't get my counter to work

**URL:** <https://forum.kirupa.com/t/cant-get-my-counter-to-work/299550>\
**Category:** flash\
**Created:** [November 6, 2009, 4:12pm UTC](https://forum.kirupa.com/t/cant-get-my-counter-to-work/299550 "2009-11-06T16:12:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rettep](https://avatars.discourse-cdn.com/v4/letter/r/c2a13f/32.png) [@Rettep](https://forum.kirupa.com/u/Rettep)\
**Post date:** [November 6, 2009, 4:12pm UTC](https://forum.kirupa.com/t/cant-get-my-counter-to-work/299550/1 "2009-11-06T16:12:20Z")

</div>

I’m trying to make a quiz in Flash, and I want to count how many points you get. I’m having each page in my quiz in a new scene (because my teacher said I should), and in the first scene i have defined a global counter:

```auto
_global.counter=0;

```

In scene two, I have a drag and drop task. The task itself works, when I put the right object in the right place I can see that it works, but I don’t know if it counts point for it. In the code for each object I have a line so it should count one point when the object is placed right. For example:

```auto
};
villa.onPress = function():Void {
    this.startDrag(true);
svar.text = "move the object to the right place";
};
villa.onRelease = function():Void {
    this.stopDrag();
if (eval(this._droptarget) == villatarget) {
        svar.text="that's right!";
**[COLOR=Red]counter = counter + 1;[/COLOR]**
}
else {
        svar.text="sorry, try again";
}

```

The counter = counter + 1; line here should do it, I think.

In the last scene I have a dynamic text field with counterout as an instance name, and the code:

```auto
counterout.text = counter;

```

Still, the there’s no text in the text field after I finished the drag and drop task… What am I doing wrong?
