Trouble with mouse jumping to center of drag box

Okay, gonna keep trying on this super cool forum . . . :love:

So I have a big map and an inset map. When you use the zoom slider a “frame” appears in the inset box to show where on the map you are. You can drag the frame around the inset and it updates in the big map. The problem is that it isn’t quite accurate. And if you click anywhere BUT the exact center of the frame on the inset and start dragging then the frame jumps to center on the mouse and doesn’t quite update on the big map.

I am NOT using StartDrag but rather some code I adapted from senocular’s website fla’s (

This is the code on the inset map:

onClipEvent (load) {
	bounds = {L:-51.7, R:51.7, T:-69, B:69};
onClipEvent (mouseMove) {
	if (this.frame.dragging) {
	                frame._x = Math.min(Math.max(_xmouse-offset[0], bounds.L), bounds.R);
		frame._y = Math.min(Math.max(_ymouse-offset[1], bounds.T), bounds.B);
onClipEvent (load) {
	scale = 1;
onClipEvent (enterFrame) {
	s = 100*100/_root.scale;
	// reverse scale = -this.frame._x*scale; = -this.frame._y*scale;
	// position based on this 10% scale
	this.frame._xscale = frame._yscale=s*scale;
	// scale to reverse

And this is the code on the drag button underneath the inset map:

	// set dragging of frame to true
	minimap.frame.dragging = true
	// calculate offset from center - relative to scale of map
	minimap.frame.offset = [minimap.minicenter._xmouse* 100/minimap.minicenter._xscale,minimap.minicenter._ymouse* 100/minimap.minicenter._xscale]
	// set dragging of map to false
	minimap.frame.dragging = false

Any suggestions?:geek: