快速业务通道

一个模仿Acdsee浏览图片的效果

作者 佚名技术 来源 服务器技术 浏览 发布时间 2012-07-11


今天帮别人解决一个地图的问题,顺便就做了这个效果。现把原文件共享出来,有需要的可以下载。
点击浏览该文件
点击浏览该文件
| http://www.Flash8.net/bbs/UploadFile/2005-7/200578181657650.swf
所有as代码如下:
//----------------------------------------------------------------------------------------------------------
Stage.showMenu = false;
Stage.scaleMode = "noScale";
fscommand(allowscale, true);
mapScale = map_mc._xscale;
stageL = 0;
stageT = 0;
stageR = map_mc._width;
stageB = map_mc._height;
stageW = mask_mc._width;
stageH = mask_mc._height;
maxZoom = 800;
minZoom = 50;
initMapZoom();
actionLabel = "放大";
_root.onLoad = function() {
var btnName = new Array();
btnName = Array("放大", "缩小", "全图", "加大", "减小", "移动");
btnNameLen = btnName.length;
for (i=1; ictrlbtn0.duplicateMovieClip("ctrlbtn"+i, i);
}
for (i=0; ictrlbtns = eval("ctrlbtn"+i);
ctrlbtns.btn_name.text = btnName[i];
ctrlbtns._x = i*(ctrlbtn0._width+5)+10;
ctrlbtns._y = ctrlbtn0._y;
ctrlbtns.vars = btnName[i];
ctrlbtns.onRollOver = function() {
this._alpha = 60;
};
ctrlbtns.onRollOut = function() {
this._alpha = 100;
};
ctrlbtns.onRelease = function() {
actionLabel = this.vars;
if (this.vars == "全图") {
initMapZoom();
}
if (this.vars == "加大") {
var mapx = ((stageL+stageR)/2-map_mc._x)/mapScale;
var mapy = ((stageT+stageB)/2-map_mc._y)/mapScale;
if (mapScale*1.2mapZoom(mapScale*1.2, mapx, mapy);
} else {
mapZoom(maxZoom, mapx, mapy);
}
}
if (this.vars == "减小") {
var mapx = ((stageL+stageR)/2-map_mc._x)/mapScale;
var mapy = ((stageT+stageB)/2-map_mc._y)/mapScale;
if (mapScale*.8>minZoom) {
mapZoom(mapScale*.8, mapx, mapy);
} else {
mapZoom(minZoom, mapx, mapy);
}
}
};
}
};
function initMapZoom() {
var msW = map_mc._width/stageW;
var msH = map_mc._height/stageH;
var mapBi = (msWmap_mc._x = stageL;
map_mc._y = stageT;
mapScale = mapScale/mapBi;
map_mc._xscale = mapScale;
map_mc._yscale = mapScale;
}
var mouseObj = new Object();
Mouse.addListener(mouseObj);
mouseObj.onMouseDown = function() {
if (_xmouse>stageL && _xmousestageT && _ymouseif (actionLabel == "放大" || actionLabel == "缩小") {
box_x = _xmouse;
box_y = _ymouse;
createEmptyMovieClip("box_mc", btnNameLen+1);
with (box_mc) {
lineStyle(1, 0xff0000, 80);
moveTo(0, 0);
lineTo(0, 1000);
lineTo(1000, 1000);
lineTo(1000, 0);
lineTo(0, 0);
_width = 1;
_height = 1;
}
mapW = map_mc._width;
mapH = map_mc._height;
box_mc.onEnterFrame = function() {
this._width = Math.abs(_xmouse-box_x);
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 !

凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!

分享到: 更多

Copyright ©1999-2011 厦门凌众科技有限公司 厦门优通互联科技开发有限公司 All rights reserved

地址(ADD):厦门软件园二期望海路63号701E(东南融通旁) 邮编(ZIP):361008

电话:0592-5908028 传真:0592-5908039 咨询信箱:web@lingzhong.cn 咨询OICQ:173723134

《中华人民共和国增值电信业务经营许可证》闽B2-20100024  ICP备案:闽ICP备05037997号