// ———————— Z O 0 M F U N C T I O N —————-
//————————————————————-
Code:
zoomtools ()
function zoomtools ()
{
// Zoom buttons // zoom-In button
zoomin_mc.onRollOut = function () { zoomin_mc.gotoAndStop ('normal'); }; zoomin_mc.onRollOver = function () { zoomin_mc.gotoAndStop ('over'); }; zoomin_mc.onPress = function () { zoomin_mc.gotoAndStop ('down'); }; zoomin_mc.onRelease = function () { zoomin_mc.gotoAndStop ('on'); //_root.createEmptyMovieClip ('maskes',-2); //_root.ImageArea.setMask (_root._parent); if (_root.ImageArea.Image.image._xscale > 200) { if (_root.ImageArea.Image.image._yscale > 200) { _root.zoom = 0; } } else { _root.zoom = 1; } };
// zoom-Out button
zoomout_mc.onRollOut = function () { zoomout_mc.gotoAndStop ('normal'); }; zoomout_mc.onRollOver = function () { zoomout_mc.gotoAndStop ('over'); }; zoomout_mc.onPress = function () { zoomout_mc.gotoAndStop ('down'); }; zoomout_mc.onRelease = function () { zoomout_mc.gotoAndStop ('on'); if (_root.ImageArea.Image.image._xscale < 35) { if (_root.ImageArea.Image.image._yscale < 35) { _root.zoom = 0; } /*if (_root.ImageArea.Image.image._yscale <= 35) { _root.ImageArea.Image.image.attachMovie ('limit','limit',12); _root.ImageArea.Image.image.limit._x = -_root.ImageArea.Image.image._width / 2; _root.ImageArea.Image.image.limit._y = -_root.ImageArea.Image.image._height / 2; } else if (_root.ImageArea.Image.image._yscale > 35) {
_root.ImageArea.Image.image.removeMovieClip (); }*/ } else { _root.zoom = -1; }
}; _root.onLoad = function () { _root.zoom = 0; };
zoom = 0; zoomperclick = 10; _root.onEnterFrame = function () { _root.createEmptyMovieClip ('ms',-23); _root.ms._width = _root.ImageArea.Image.image._width; _root.ms._height = _root.ImageArea.Image.image._height; if (_root.zooming < _root.zoomperclick) { _root.zooming++; _root.ImageArea.Image.image._xscale = _root.ImageArea.Image.image._xscale + _root.zoom; _root.ImageArea.Image.image._yscale = _root.ImageArea.Image.image._yscale + _root.zoom; } //_root.ImageArea.setMask(_root.ms) };
zooming = zoomperclick + 1; punct = new Object (); _root.speed.restrict = "1-9"; _root.speed.maxChars = 1; zoomers = new Object (); zoomers.onMouseDown = function () { pozX = _root._xscale; pozY = _root._yscale; if ((_root.ImageArea.Image.image._xscale > 100) && (_root.ImageArea.Image.image._yscale> 100) && (_root.zoom < 35)) { _root.zoom = 0; } else if ((_root.ImageArea.Image.image._xscale < 450) && (_root.ImageArea.Image.image._yscale < 450) && (_root.zoom < 250)) { _root.zoom = 0; } if (!((pozX > 200) && (pozY < 200))) { _root.zooming = 0; } }; Mouse.addListener (zoomers);
}