I can help but before I must be sure I understand correctly;
The hammer is a draggable item, and you want it to stick to one of the boxes when it's dragged there, right?
If that is so, try this (with inventory slots named hit1, hit2 - hit5) :
onClipEvent(load){
var initx:Number = _x;
var inity:Number = _y;
var target:String = "this";
var drag:Boolean = false;
//target will be the MC on which the draggable item will stick
//unless it is being dragged
}
onClipEvent(enterFrame){
if(drag){
_x = _root._xmouse;
_y = _root._ymouse;
}else{
_x = _root[target]._x;
_y = _root[target]._y;
}
}
onClipEvent(mouseDown){
if(this.hitTest(_root._xmouse, _root._ymouse)){
initx = _x;
inity = _y;
drag = true;
_root[target].taken = false;
target = "this";
//when dragging starts, it sets the "taken" variable of its
//previous target to false, so it can hold another item
}
}
onClipEvent(mouseUp){
drag = false;
for(i:Number = 0; i <= 5; i ++){
if(this.hitTest(_root["hit"+i]) && !_root["hit"+i].taken){
target = "hit"+i;
_root["hit"+i].taken = true;
break;
//scroll through hit1 to hit5 -> if it touches it, and it's
//not taken, then set this as target and stop loop.
}
}
if(target == "this"){
_x = initx;
_y = inity;
//if it did not touch an inventory slot, reset position
}
}
This code, when applied to a MC, will make it behave as a draggable item
If that's not what you need feel free to ask