粘着我的鼠标的效果,

      Flash学习 2005-7-8 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;
    }

标签集:TAGS:
回复Comments() 点击Count()

回复Comments

{commentauthor}
{commentauthor}
{commenttime}
{commentnum}
{commentcontent}
作者:
{commentrecontent}