谢 谢 收 藏 http://www.qqread.com/flash/s062120204.html
教程:
其他部分就不讲了,看看源文件就知道了。主要说说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)
}
点击下载该文件
更多内容请看电信运营商专栏专题,或进入讨论组讨论。
其他部分就不讲了,看看源文件就知道了。主要说说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)
}
点击下载该文件
相关图文阅读
频道图文推荐
健 康 咨 询
时 尚 咨 询
相关专题
- 电信运营商专栏 (4039篇文章)
- Flash教程 常用短语trace();使用 (0次浏览)
- 贪吃蛇游戏代码翻译 (0次浏览)
- 把fla文件输出成和swf一样的gif文件 (0次浏览)
- 什么是AS2.0面向对象编程 (0次浏览)
- AS3学习笔记 (0次浏览)
- Flash交互式动画之星座查询器制作 (0次浏览)
- AS3.0的类及绑定 (0次浏览)
- AS3 中的反射 (0次浏览)
- AS3 技巧和提示 (0次浏览)
- 利用引导线制作动态爱心两例 (0次浏览)



