I guess you would have to calculate the centre of the image, then corrilate that to ensure the MX zoomed, and shifted so the point you clicked was the centre.
import mx.transitions.Tween;
import mx.transitions.easing.Regular;
var percentZoom = 300;
pic_mc.onRelease = function () {
var zoomx:Tween = new Tween(pic_mc,"_xscale",Regular.easeOut,100,percentZoom,1,true);
var zoomy:Tween = new Tween(pic_mc,"_yscale",Regular.easeOut,100,percentZoom,1,true);
var panx:Tween = new Tween(pic_mc,"_x",Regular.easeOut,pic_mc._x,pic_mc._x - pic_mc._xmouse * percentZoom/100,1,true);
var pany:Tween = new Tween(pic_mc,"_y",Regular.easeOut,pic_mc._y,pic_mc._y - pic_mc._ymouse * percentZoom/100,1,true);
}
@DaRicardo, going to try yours (i am too slow today)
[edit] tried your suggestion daRicardo, but i am already at that point.
@randomAgain, with boundaries i mean, if you click in the lower left corner some part of the image is off stage.
[edit] it might be better described as pan limits??
I think what you need to do is multiply the panning distance by the scale factor (when you zoom in, you actually need to move more _x and _y to zoom in on the right spot.)
daricardo, tx almost i changed it and now it almost works.
Just when you click near the edges it shows an offset. I think i need to recalculate the _x and _y a bit more when you are near the edges. Gonna check your panning/scaling suggestion