鼠标跟随其实并不难,最简单的就是startDrag(),配合mouse.hide()就可以改变鼠标在播放器内的样子,例如: onClipEvent(enterFrame){

mouse.hide()

startDrag(this,true)

}

好,稍微复杂一点,让鼠标移动的时候,后面会有几个mc跟着运动。

建立一个空白mc,用来放代码。建立3个key frame

frame1:

i=0

frame2:

if(i<=7){

duplicateMovieClip("_root.mc","_root.cm"+i,i);

}i++//复制mc

frame3:

if(i>=7){

i=0

}

gotoAndPlay(2)

运行一下试试:)

在复杂一点呢?让一些文字跟着鼠标运动呢?

xposition_Array=new Array()

yposition_Array=new Array()//定义两个数组,用来存放mouse的位置

myword = function(depth){

attachMovie("word","word" + depth,depth);

return this["word" + depth];

}//加载一个影片word,返回起name["word"+depth]

function mymouse (word_string, wordx)

{

if(wordx == undefined) this.lx = 20;

else this.lx = wordx;

this.string = word_string;

this.Read_String();

};//定义mymouse这个类,里面进行初试化

Mymouse.prototype.Read_String = function()

{

this.word_mc = new Array();

this.wordlenth = this.string.length;//wordlenth等于字符串长度

for (var i = 0; i < this.wordlenth; i ++) {

this.word_mc[i] = myword(i);//myword有

reture this["word"+depth],所以this.word_mc[i]就等于"word"+depth

this.word_mc[i].word = this.string.slice(i, i + 1);//从string中读取文字,写如this.word_mc[i]中的文本框word中

}

};

Mymouse.prototype.move = function (){

x_position=_root._xmouse

y_position=_root._ymouse

if(xposition_Array.length>=this.wordlength&&yposition_Array.length>=this.wordlength){

xposition_Array.shift()

yposition_array.shift()

xposition_Array.push(x_position)

yposition_Array.push(y_position)

}else{xposition_Array.push(x_position)

yposition_Array.push(y_position)

}

//将mouse的位置写入数组,记录下来

for(i=0;i<=this.wordlength-1;i++){

this.word_mc[i]._x=xposition_Array[this.wordlength-i-1]

this.word_mc[i]._y=yposition_Array[this.wordlength-

i-1]

}

for(i=0;i<=this.wordlenth-1;i++){

if(xposition_Array[i]==xposition_Array[i-1]&&yposition_Array[i]==yposition_Array[i-1]){

this.word_mc[i]._x=this.word_mc[i-1>._x+this.lx

}

}//定义鼠标静止后文字的位置

}

好,函数的定义部分就完成了,下面就新建一个图层写下

my_mouse = new Mymouse("我真的好爱你哦",20);

}

_root.onEnterFrame = function()

{

my_mouse.Mymove();

}

好了,运行一下试试 :) move部分可以自己修改,达到自己想要的效果。