# Help With Resetting

**URL:** <https://forum.kirupa.com/t/help-with-resetting/257771>\
**Category:** flash\
**Created:** [April 16, 2008, 10:48pm UTC](https://forum.kirupa.com/t/help-with-resetting/257771 "2008-04-16T22:48:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![A\_String](https://avatars.discourse-cdn.com/v4/letter/a/91b2a8/32.png) [@A\_String](https://forum.kirupa.com/u/A_String)\
**Post date:** [April 16, 2008, 10:48pm UTC](https://forum.kirupa.com/t/help-with-resetting/257771/1 "2008-04-16T22:48:51Z")

</div>

To help me with learning to program AS3 (I’m a complete newb), I am making a photo album with a button that rotates the images. The problem I’m having is, the button’s numbered click event is repeated so it I get a warning about a duplicate:

stop();

hb\_btn.addEventListener(MouseEvent.CLICK, click1)  
hb2\_btn.addEventListener(MouseEvent.CLICK, click2)  
hb3\_btn.addEventListener(MouseEvent.CLICK, click3)  
hb4\_btn.addEventListener(MouseEvent.CLICK, click4)

function click1 (evt) {  
var url = “[http://www.URL1.com](http://www.URL1.com)”  
navigateToURL(new URLRequest(url))  
}

function click2 (evt) {  
var url = “[http://www.URL2.com](http://www.URL2.com)”  
navigateToURL(new URLRequest(url))  
}

function click3 (evt) {  
var url = “[http://www.URL3.com](http://www.URL3.com)”  
navigateToURL(new URLRequest(url))  
}

function click4 (evt) {  
gotoAndPlay (47)  
}

Frame 47 rotates the images and stops with this code:

stop();

hb\_btn.addEventListener(MouseEvent.CLICK, click1)  
hb2\_btn.addEventListener(MouseEvent.CLICK, click2)  
hb3\_btn.addEventListener(MouseEvent.CLICK, click3)  
hb4\_btn.addEventListener(MouseEvent.CLICK, click4)

function click1 (evt) {  
var url = “[http://www.URL4.com/](http://www.URL4.com/)”  
navigateToURL(new URLRequest(url))  
}

function click2 (evt) {  
var url = “[http://www.URL5.com](http://www.URL5.com)”  
navigateToURL(new URLRequest(url))  
}

function click3 (evt) {  
var url = “[http://www.URL6.com/](http://www.URL6.com/)”  
navigateToURL(new URLRequest(url))  
}

function click4 (evt) {  
gotoAndPlay (54)  
}

So, because of the duplicate error, I gave each new set a new set of click event numbers. That fixed the error. Problem was, when I loop back to the beginning from the end frame, it won’t play and just loops the last frame.

What I need to do is find a way to reset the numbered click event so I can reuse the click1, click2, click3 and click4. Is there a way to reset the value so I can reuse it?
