я бы несколько иначе сделал драг, но если не трогать все остальное, то.

Код AS3:
private function onMoveInParentBox1(event:MouseEvent):void
{
var targetX : Number = parentBox.mouseX - shiftX;
var targetY : Number = parentBox.mouseY - shiftY;
var bounds : Rectangle = box1.getBounds(parentBox);
var ownBounds : Rectangle = box1.getBounds(box1);
var xDiff : Number = bounds.width - PARENT_SIZE;
var yDiff : Number = bounds.height - PARENT_SIZE;
bounds.x = targetX + ownBounds.x;
bounds.y = targetY + ownBounds.y;
if(bounds.x > 0)
{
targetX = -ownBounds.x;
}
else if(bounds.x < -xDiff)
{
targetX = -xDiff - ownBounds.x;
}
if(bounds.y > 0)
{
targetY = -ownBounds.y;
}
else if(bounds.y < -yDiff)
{
targetY = -yDiff - ownBounds.y;
}
box1.x = targetX;
box1.y = targetY;
}