El código a continuación:
Código :
incremento = 2; function zoom(x,y,ancho,alto, aceleracion) { mapa.onEnterFrame = function() { this._x += (x-this._x)/aceleracion; this._y += (y-this._y)/aceleracion; this._width += (ancho-this._width)/aceleracion; this._height+= (alto-this._height)/aceleracion; if (Math.abs(x-this._x)<0.5 && Math.abs(y-this._y)<0.5 && Math.abs(ancho-this._width)<0.5 && Math.abs(alto-this._height)<0.5) { this._x = x; this._y = y; this._width = ancho; this._height = alto; delete this.onEnterFrame; } }; }; onMouseDown =function(){ if (mapa.hitTest(_xmouse,_ymouse)){ Alto = incremento*mapa._height; Ancho = incremento*mapa._width; x = _xmouse-((_xmouse-mapa._x) * incremento); y= _ymouse-((_ymouse-mapa._y) * incremento); zoom(x,y,Ancho,Alto,3); } };