本页面由 Flash 保存计划 从 Internet Archive 存档还原 · 快照 2005-12-26 · 原址 http://flash8.net/teach/3158.htm ← Flash 保存计划

根据寒冰的图片效果做的一种图片效果

作者:樵下客   类型:原创   来源:闪吧

  代码和他有所不同。和其他人的如有雷同,纯属巧合。
点击浏览该文件
点击浏览该文件

教程:

其他部分就不讲了,看看源文件就知道了。主要说说AS部分。

拖动块上代码:


on (press) {
ymin=_root.tp_mc.tp_mc1._width-_root.tp_mc.drag._width;
xmin=_root.tp_mc.tp_mc1._height-_root.tp_mc.drag._height;
startDrag("_root.tp_mc.drag",false,0,0,ymin,xmin)//拖动按钮,拖动范围设置。
trace(ymin);
trace(xmin);
}
on (release) {
stopDrag();
}//停止拖动
桢上代码:
this.drag._x=0;
this.drag._y=0;//定义拖动块的初始位置;
this.drag1._x=-150;
this.drag1._y=30;//定义遮罩块的初始位置;
this.tp_mc2._x=-150;
this.tp_mc2._y=30;//定义被遮图片的初始位置;
this.drag1._xscale=170;
this.drag1._yscale=170;//遮罩块放大
this.tp_mc2._xscale=170;
this.tp_mc2._yscale=170;//将被遮罩图片放大;
speed=0.5;
xtpmc=_root.tp_mc.tp_mc2._x;
ytpmc=_root.tp_mc.tp_mc2._y;//被遮图片初始位置;
bs=this.tp_mc2._width/this.tp_mc1._width;//大小图片之间倍数;
_root.tp_mc.tp_mc2.setMask(_root.tp_mc.drag1);//遮罩tp_mc2
trace("tp:"+bs);
_root.onEnterFrame=function(){
_root.tp_mc.tp_mc2._x+=((xtpmc+_root.tp_mc.drag._x*-bs)-_root.tp_mc.tp_mc2._x)*speed;
_root.tp_mc.tp_mc2._y+=((ytpmc+_root.tp_mc.drag._y*-bs)-_root.tp_mc.tp_mc2._y)*speed;//缓移;
trace(_root.tp_mc.drag._x*bs)
}
   责任编辑:uufeng    时间:2005年3月30日

正在加载评论...