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 (www.umbc.edu/interactive).
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);
updateAfterEvent();
}
}
onClipEvent (load) {
scale = 1;
}
onClipEvent (enterFrame) {
s = 100*100/_root.scale;
// reverse scale
_root.map.center._x = -this.frame._x*scale;
_root.map.center._y = -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:
on(press){
// 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]
}
on(release,releaseOutside){
// set dragging of map to false
minimap.frame.dragging = false
}
Any suggestions?:geek: