5D艺术网首页
商城
|
资讯
|
作品
|
博客
|
教程
|
论坛
登录
注册
加为好友
发短消息
来自:
性别:秘密
最后登录:2007-09-22
http://yuheduo.5d.cn/
首页
|
新闻
|
话题
|
博客
|
相册
|
艺术作品
|
社交关系
|
留言板
|
社交圈
2005/07/08 | 粘着我的鼠标的效果,
类别(Flash学习)
|
评论
(0)
|
阅读(92)
|
发表于 21:46
粘着我的鼠标的效果,简单的效果,我想可以做导航用啊
MovieClip名是:mc1--mc6;
ActionScript代码如下:
//放在第一帧中
function move_mc(){
var h=0.4;
var target_X:Number =this.o_X;
var target_Y:Number =this.o_Y;
Length=Math.sqrt(Math.pow (_root._xmouse-this.o_X,2)+Math.pow(_root._ymouse-this.o_Y,2));
if(Length<100){
target_X=_root._xmouse;
target_Y=_root._ymouse;
}
this._x+=(target_X-this._x)*h;
this._y+=(target_Y-this._y)*h;
}
for(i=1;i<=6;i++){
var t:MovieClip =_root["mc"+i];
t.o_X=t._x;
t.o_Y=t._y;
t.onEnterFrame=move_mc;
}
0
评论
Comments
日志分类
首页
[149]
blog记事
[7]
Flash学习
[85]
教学记忆
[21]
娱乐影音
[9]
我的收藏
[27]
PhotoShop学习
[0]