# Counter help?

**URL:** <https://forum.kirupa.com/t/counter-help/27723>\
**Category:** Uncategorized\
**Created:** [August 5, 2003, 11:40pm UTC](https://forum.kirupa.com/t/counter-help/27723 "2003-08-05T23:40:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mcthfg](https://avatars.discourse-cdn.com/v4/letter/m/898d66/32.png) [@mcthfg](https://forum.kirupa.com/u/mcthfg)\
**Post date:** [August 5, 2003, 11:40pm UTC](https://forum.kirupa.com/t/counter-help/27723/1 "2003-08-05T23:40:12Z")

</div>

Hey all,

I’m using a very simple counter code:

counter2++;  
if (counter2\<10) {  
gotoAndPlay(131);  
}

This counter is in a scene that loops forever. However, the counter only counts through on the first time through the scene. How do I reset the counter each time, so it counts each time the scene is looped?

Thanks!

---

<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:** [August 5, 2003, 11:47pm UTC](https://forum.kirupa.com/t/counter-help/27723/2 "2003-08-05T23:47:17Z")

</div>

I’m not sure I understand what you are saying, but my guess to what you are saying is right before you go back into that loop, somewhere, on someframe you have to tell flash that it’s a zero again:

```auto

counter2=0;

```

---

<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:** [August 6, 2003, 3:10pm UTC](https://forum.kirupa.com/t/counter-help/27723/3 "2003-08-06T15:10:13Z")

</div>

That’s it exactly.

Thanks for the tip.
