# Reset button help needed

**URL:** <https://forum.kirupa.com/t/reset-button-help-needed/172532>\
**Category:** flash\
**Created:** [December 15, 2005, 7:34am UTC](https://forum.kirupa.com/t/reset-button-help-needed/172532 "2005-12-15T07:34:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tildy](https://avatars.discourse-cdn.com/v4/letter/t/9dc877/32.png) [@Tildy](https://forum.kirupa.com/u/Tildy)\
**Post date:** [December 15, 2005, 7:34am UTC](https://forum.kirupa.com/t/reset-button-help-needed/172532/1 "2005-12-15T07:34:38Z")

</div>

Hi. I am learning Flash and I have made a photo puzzle using “drag and drop” actionscripting.

My puzzle has 20 pieces and 20 targets set up on a grid. Everything exists on separate layers but in one frame in the main timeline. The puzzle works and I also have a “hint” button that reveals the completed puzzle. What I am trying to figure out is how I can script a button that resets the puzzle and the photo hint back to their beginning state.

I tried to upload a smaller version of the puzzle for anyone who wants to see it, but it’s too large to upload. I have included the actionscript for each puzzle piece and for the hint button below.

Any help would be appreciated. Thanks.

Action script on each puzzle piece (each puzzle piece is a movie clip):

on (press){  
startDrag(this, true);  
this.swapDepths(100);  
}  
on (release){  
stopDrag();  
if  
(this.\_droptarget=="/target1"){  
this.\_x = 353.7;  
this.\_y = 53.1;  
}else{  
this.\_x = 218.3;  
this.\_y = 302.1;  
}  
}

Action script on the hint button:

on (release){  
hintMov.nextFrame();  
}  
//advances one frame in the hint movie clip
