Drag within boundaries problem

I have a drag/zoom viewer I’m trying to get to work (currently just zoom in and drag), and am having some issues with scaling. Per some suggestions to keep zoom from jumping to registration point of a movieclip, I have the movieclip “pan” nested in movieclip “box”, and drag “pan” while scaling “box” within “bound” square. The problem is that when I scale “box”, everytime it pushes the actual drag boundaries a little further outside of the “bound” square on the right and bottom. If I change the apply scale to the nested “pan”, everything works fine, but scales to the registration point.
My code:


import flash.events.MouseEvent;

box.pans.addEventListener(MouseEvent.MOUSE_DOWN,onDown);
box.pans.addEventListener(MouseEvent.MOUSE_UP,DragStop);
BTN.addEventListener(MouseEvent.CLICK, zoom);
box.pans.addEventListener(MouseEvent.MOUSE_OUT, DragStop);
function zoom(evt:MouseEvent):void
{
    box.scaleX += 1;
    box.scaleY += 1;
}
function DragStop(event:Event){
        event.target.stopDrag();
}
function onDown(evt:MouseEvent):void {
    box.pans.startDrag(false);
    this.addEventListener(Event.ENTER_FRAME,checkBounds);
}

function checkBounds(evt:Event):void {
    if(box.pans.x > bound.x) {
        box.pans.x = bound.x;
    } else if(box.pans.x < bound.x-(box.pans.width-bound.width)) {
        box.pans.x = bound.x-(box.pans.width-bound.width);
    }
   
    if(box.pans.y > bound.y) {
        box.pans.y = bound.y;
    } else if(box.pans.y < bound.y-(box.pans.height-bound.height)) {
        box.pans.y = bound.y-(box.pans.height-bound.height);
    }
}

I’m really just trying understand different methods of pan/drag/zoom, and any insight would be greatly appreciated.