Please see
http://www.sergemedia.net/ds2/map/lissarazoomfix.html
Move zoom slider to 200 and back to 50, back and forth.
Notice how map zooms diagonally to some point in the top left.
I am trying to get the map to zoom in and out from center of current viewing area. I have been told it has to do with my registration point. I have been told to move to center. I have been moving it round and round trying to get it to co-operate, but not much luck.
The map is a MC with a gra instance inside. I have set the registration of both to the center, but it still does not seem to work properly. So I have tried moving to other places. The bitmap map image in the gra is located at x=0, y=-600. Does that need to be 0,0?
I hope its not too confusing.
This is the code to my zoom slider, if its related to my problem…
onClipEvent(load){
scrollMin = _root.range._x+_root.range._width // minimum _x value possiible for scrollbar
scrollMax = _root.range._x // maximum _x value possiible for scrollbar
lowestScale = 50 // lowest desired scale of map in %
highestScale = 100 // highest desired scale of map in %
_x = scrollMin + (scrollMax - scrollMin)/25 //starting point
scaleFactor = Math.pow(highestScale/lowestScale,1/(scrollMax-scrollMin)) // variable for SetScale
function SetScale(){
// calculates scale and sets it
_root.scale = _root.map_mc._xscale = _root.map_mc._yscale = lowestScale * Math.pow(scaleFactor,(scrollMax-_x))
}
SetScale()
}
onClipEvent(mouseMove){
if (dragging){
_x = Math.min(Math.max(_parent._xmouse,scrollMax),scrollMin)
SetScale()
updateAfterEvent();
}
}