求一个跟随鼠标游动的鱼的FLASH代码 请高手进
元件1头,连接名为:yt
元件2身,连接名:ys
元件3尾巴,连接名:yz
主场景第1帧代码:
this.attachMovie("yt","xy0",21);
for (i=1;i<21;i++){
if(i == 13){
this.attachMovie("yz","xy"+i,i);
} else {
this.attachMovie("ys","xy"+i,i);
}
cys = eval("xy"+i);
cys._yscale -= i*5;
cys._xscale -= i*5;
}
第2帧代码:
ytx = _xmouse - xy0._x;
yty = _ymouse - xy0._y;
ytz = Math.atan2(yty,ytx)*180/Math.PI;
xy0._rotation = ytz;
xy0._x += ytx/10;
xy0._y += yty/10;
n=21;
while(n>0){
hys = eval("xy"+n);
qys = eval("xy"+(n-1));
ysx = qys._x - hys._x;
ysy = qys._y - hys._y;
ysz = Math.atan2(ysy,ysx)*180/Math.PI;
hys._rotation = ysz;
hys._x = qys._x;
hys._y = qys._y;
n--;
}
第3帧代码:
gotoAndPlay(2);