一个改编过的图片展示效果
作者 佚名技术
来源 服务器技术
浏览
发布时间 2012-07-13
这是原效果: 点击浏览该文件 这是我改编代码后的效果: 点击浏览该文件 改编后的代码全放在第一帧上了: showBL = 22; //图片的数量+1 pailBL = 1; //排列小图片用的变量 scaleBL = 13; //小图片的缩放比即13% scale_xy = 0; //使大图变小的变量 big_x = 668; //展开时大图位置的X坐标 big_y = 325; //展开时大图位置的Y坐标 bx = 0; //定义使图片带有惯性缓冲展开的X轴变量 by = 0; //定义使图片带有惯性缓冲展开的Y轴变量 x_ZB; //记录每个小图的X坐标 y_ZB; //记录每个小图的Y坐标 lag_BL = 0; //廷迟关闭变量 for (var i = 1; i duplicateMovieClip(showMC, "showMC"+pailBL, pailBL); this["showMC"+pailBL]._x = this["showMC"+pailBL].x_ZB=(n-1)*75+70; this["showMC"+pailBL]._y = this["showMC"+pailBL].y_ZB=(i-1)*55+80; this["showMC"+pailBL]._xscale = scaleBL; this["showMC"+pailBL]._yscale = scaleBL; this["showMC"+pailBL].gotoAndStop(pailBL+1); pailBL++; } } //上代码为复制并且排列小图片 MovieClip.prototype.openFun = function() { path_name.closederBL = false; if (Math.abs(this._x-big_x)<0.5) { if (this._xscale>100) { this._xscale = 100; this._yscale = 100; this.pressBL = !this.pressBL; } else { this._x = big_x; this._y = big_y; this._xscale += 2; this._yscale += 2; } } else { bx = (bx+0.15*(big_x-this._x))*0.8; by = (by+0.15*(big_y-this._y))*0.8; this._x += bx; this._y += by; } }; MovieClip.prototype.closeFun = function() { path_name.closederBL = true; if (lag_BL>50) { if (this._xscale>scaleBL+5) { bx = (this.x_ZB-this._x)*0.2; by = (this.y_ZB-this._y)*0.2; this._x += bx; this._y += by; scale_xy = (scaleBL-this._xscale)*0.2; this._xscale = this._yscale += scale_xy; } else { this._x = this.x_ZB; this._y = this.y_ZB; this._xscale = this._yscale=scaleBL; this.pressBL = !this.pressBL; lag_BL = 0; } } lag_BL++; }; for (var i = 1; i this.swapDepths(getNextHighestDepth()); if (path_name == this) { this.openBL = !this.openBL; this.closeBL = !this.openBL; if (!this.pressBL) { this.pressBL = !this.pressBL; } } else { this.openBL = !this.openBL; this.closeBL = !this.openBL; this.pressBL = !this.pressBL; if (!path_name.closederBL) { path_name.openBL = !path_name.openBL; path_name.closeBL = !path_name.openBL; if (!path_name.pressBL) { path_name.pressBL = !path_name.pressBL; } } } path_name = this; }; } onEnterFrame = function () { for (var i = 1; i if (this["showMC"+i].openBL) { this["showMC"+i].openFun(); } if (this["showMC"+i].closeBL) { this["showMC"+i].closeFun(); } } } }; 关键词: |
凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢! |
你可能对下面的文章感兴趣
上一篇: 关于flash游戏的“录像”功能下一篇: 猜数字游戏--AS处女作
关于一个改编过的图片展示效果的所有评论