ActionScript Code:
var zoom:Boolean;
var dir:Number = 0;
var i:Number = 0;
var pt;
var pt2;
zoom_this.onRelease = function() {
if (i>0) {
return;
}
zoom = true;
dir == 1 ? (dir=-1) : (dir=1);
if (dir == 1) {
var pt = {x:this._xmouse, y:this._ymouse};
}
};
zoom_this.onEnterFrame = function() {
if (!zoom) {
return;
}
this._xscale += dir*i*100/10;
this._yscale += dir*i*100/10;
pt2 = {x:pt.x, y:pt.y};
this.localToGlobal(pt2);
this._x -= (pt2.x-pt.x);
this._y -= (pt2.y-pt.y);
i++;
if (i == 10) {
zoom = false;
i = 0;
}
};