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