粘着我的鼠标的效果,简单的效果,我想可以做导航用啊
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;
}
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;
}
回复Comments
作者:
{commentrecontent}