There's a couple things you could do. First off, change the script for the pieces to this:
onClipEvent(load){
draggable=false;
}
on(press){
if(draggable==true){
startDrag(this);
}
}
on(release){
stopDrag();
}
If you're using that script, also make sure the pieces are Movie Clips and not buttons. Then make tiny squares in the center of where the piece should go, so that the registry point should touch it if it's in the center. On the square Movie Clip (which should be Alpha 0%) should be:
onClipEvent(enterFrame){
if(this.hitTest(_parent.a1){
_parent.a1.draggable=false;
}
}
And of course change the instance names for each piece and make corresponding script for them. I used a1 because you can document a piece like Battleship, naming things by an alphabetical row and numeric columns.
The second way is to make something like this on each piece:
onClipEvent(enterFrame){
if(this._x>some1||this._x<some2||this._y>some3||this._y<some4){
_x=some5;
_y=some6;
draggable=false;
}
}
You'll have to fool around with what some1, 2, 3, and 4 are. Basically it will check if that piece's X and Y are between certain points, and if they are, to make it not drag anymore. You should also set some5 and some6 so that if it's in the range it snaps instantly to that location.