| 鼠标跟随的类实现 |
作者:thymecd 文章来源:闪吧 点击数:
更新时间:2004-12-22 11:19:48 |
|
| |
|
鼠标跟随效果很常见,制作的方法也很多。上面的效果是用类实现的。 MouseChaser.as:
class MouseChaser extends MovieClip { var speed = 0.2; function MouseChaser() { this.onEnterFrame = function() { this._x += (_root._xmouse-this._x)*speed; this._y += (_root._ymouse-this._y)*speed; }; } }
为元件添加链接:
 .fla文件第1帧:
attachMovie("cir", "cir", 1);
测试,搞定!
|
| 教程录入:流云 责任编辑:流云
|
|
上一篇教程: 流水效果
下一篇教程: 水色一天 |
| 【字体:小
大】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口】
|