Flash实例:模仿Acdsee浏览图片的效果
2008-04-02 11:05:24来源:互联网 阅读 ()
今天帮别人解决一个地图的问题,顺便就做了这个效果。
任何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; i
}
for (i=0; 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.2
} 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 = (msW
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 && _xmouse
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);
标签:
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有
上一篇: 让Flash8支持有透明度变化的遮罩
下一篇: FLASH宠物使用说明
IDC资讯: 主机资讯 注册资讯 托管资讯 vps资讯 网站建设
网站运营: 建站经验 策划盈利 搜索优化 网站推广 免费资源
网络编程: Asp.Net编程 Asp编程 Php编程 Xml编程 Access Mssql Mysql 其它
服务器技术: Web服务器 Ftp服务器 Mail服务器 Dns服务器 安全防护
软件技巧: 其它软件 Word Excel Powerpoint Ghost Vista QQ空间 QQ FlashGet 迅雷
网页制作: FrontPages Dreamweaver Javascript css photoshop fireworks Flash