[F8] Zooming to center, not registration point
I'm sure this topic has come up quite a bit, but despite looking through old posts I'm still having problems zooming to the center of the viewable area rather than zooming to the registration point.
I have a horizontal slider bar that incorporates the following control to set the zoom level on a map:
Code:
handle.onPress = function() {
this.startDrag(false, 0, 0, 92, 0);
};
handle.onRelease = function() {
this.stopDrag();
};
handle.onEnterFrame = function() {
_level0.Map.targetWidth = (this._x*20)+1133; //20 is zoom multiplier, 1113 is the original width
_level0.Map.targetHeight = (this._x*20)+976 //20 is zoom multiplier, 976 is the original height
};
The above works fine and zooms smoothly, but it zooms to the registration point (obviously).
Is there an easy formula that incorporates the above script and sets the x and y formula according to the zoom level? I know it's been suggested to place the whole map into a new MC and set the new MC registration point to the center, but because of the complexities of the map MC I'd rather change the x and y values on the fly.
Any help would be deeply appreciated! Thanks!