Flash实例:模仿Acdsee浏览图片的效果(2)

2008-04-02 11:05:24来源:互联网 阅读 ()

新老客户大回馈,云服务器低至5折



  this._height = Math.abs(_ymouse-box_y);

  this._x = _xmousethis._y = _ymouse};

  }

  if (actionLabel == "移动") {

  left = stageR-map_mc._width;

  top = stageB-map_mc._height;

  right = 0;

  bottom = 0;

  map_mc.startDrag(false, left, top, right, bottom);

  }

  }

  };

  mouseObj.onMouseUp = function() {

  if (box_mc != undefined) {

  boxW = box_mc._width box_mc._x>stageR ? stageR-box_mc._x : box_mc._width;

  boxH = box_mc._height box_mc._y>stageB ? stageB-box_mc._y : box_mc._height;

  mouseX = box_mc._width != 0 ? box_mc._x : _xmouse;

  mouseY = box_mc._height != 0 ? box_mc._y : _ymouse;

  if (actionLabel == "放大") {

  large();

  }

  if (actionLabel == "缩小") {

  small();

  }

  box_mc.removeMovieClip();

  }

  if (actionLabel == "移动") {

  map_mc.stopDrag();

  }

  };

  function large() {

  _l1 = boxW == 0 ? 1.2 : stageR/boxW;

  _l2 = boxH == 0 ? 1.2 : stageB/boxH;

  point = _l1<_l2 ? _l1 : _l2;

  var mapx = ((mouseX _xmouse)/2-map_mc._x)/mapScale;

  var mapy = ((mouseY _ymouse)/2-map_mc._y)/mapScale;

  if (map_mc._xscaleif (mapScale*pointmapZoom(mapScale*point, mapx, mapy);

  } else {

  mapZoom(maxZoom, mapx, mapy);

  }

  }

  }

  function small() {

  _l1 = boxW == 0 ? 0.8 : boxW/stageR;

  _l2 = boxH == 0 ? 0.8 : boxH/stageB;

  point = _l1>_l2 ? _l1 : _l2;

  var mapx = (_xmouse-map_mc._x)/mapScale;

  var mapy = (_ymouse-map_mc._y)/mapScale;

  if (map_mc._xscale>minZoom) {

  if (mapScale*point>minZoom) {

  mapZoom(mapScale*point, mapx, mapy);

  } else {

  mapZoom(minZoom, mapx, mapy);

  }

  }

  }

  function mapZoom(map_scale, map_x, map_y) {

  map_mc._xscale = map_scale;

  map_mc._yscale = map_scale;

  mapScale = map_scale;

  map_mc._x = (stageL stageR)/2-map_x*mapScale;

  map_mc._y = (stageT stageB)/2-map_y*mapScale;

  //---------------------------------------------------

  map_mc._x = map_mc._x map_mc._widthmap_mc._x = map_mc._x>0 ? 0 : map_mc._x;

  map_mc._y = map_mc._y map_mc._heightmap_mc._y = map_mc._y>0 ? 0 : map_mc._y;

  }


标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇: 让Flash8支持有透明度变化的遮罩

下一篇: FLASH宠物使用说明