I found this great script from HERE.
But the problem Im having is reversing it.
[AS]stateArray = new Array(“state01”, “state02”, “state03”, “state04”, “state05”);
for (i=0; i<stateArray.length; i++) {
map[stateArray*].onRollOver = function() {
_root.zoomToState(this._x, this._y, this._height, this._width);
};
}
targetX = Stage.width/2;
targetY = Stage.height/2;
targetW = Stage.width-50;
targetH = Stage.height-50;
function zoomToState(stateX, stateY, stateH, stateW) {
stateScale = targetW/stateW;
if (stateScalestateH>targetH) {
stateScale = targetH/stateH;
}
mapX = targetX-(stateXstateScale);
mapY = targetY-(stateYstateScale);
_root.onEnterFrame = function() {
map._x -= (map._x-mapX)/3;
map._y -= (map._y-mapY)/3;
map._xscale -= (map._xscale-(stateScale100))/3;
map._yscale -= (map._yscale-(stateScale100))/3;
if (Math.abs(map._x-mapX)<.5 && Math.abs(map._y-mapY)<.5 && Math.abs(map._xscale-(stateScale100))<.5) {
delete (_root.onEnterFrame);
}
};
}
[/AS]
[COLOR=#000000]I’ve changed it so that the zoom action takes place on a RollOver (not Release). I wanted it to zoom back to its original state on RollOut.[/COLOR]
[COLOR=#000000]Here is my slightly adjusted version so far.[/COLOR]