Flash模块怎么变大变小 还有鼠标跟随怎么弄 没效果 先谢谢了
- 提问者网友:蓝莓格格巫
- 2021-07-17 10:47
- 五星知识达人网友:躲不过心动
- 2021-07-17 11:19
制作鼠标跟随我会,文字跟随和图片跟随都行
文字型:
1.添加一个文本框,改成动态文本,实例名为_txt,再转成影片剪辑,实例名为_mc
2.在帧上添加代码:
txt_array=["今","生","无","缘","..."];//在这里把你要加的文字按相应的格式输完整,再数数字数,把下面的
for(j=0;j<5;j++){ ////////////////////////////“5”改成字数
_mc.duplicateMovieClip("_mc"+j,j+100);
this["_mc"+j]._txt.text=txt_array[j];
this["_mc"+j]._txt.autoSize=true;
this["_mc"+j]._txt.selectable=false;
this["_mc"+j].vx=this["_mc"+j].vy=0;
}
onEnterFrame=function(){
mcxy(_mc0,_xmouse,_ymouse);
for(j=1;j<5;j++){
mcxy(this["_mc"+j],this["_mc"+(j-1)]._x,this["_mc"+(j-1)]._y);
}
};
function mcxy(_mc,a,b){
_mc.vx+=(a-_mc._x)*.5;
_mc.vy+=(b-_mc._y)*.5;
_mc.vx*=.5;
_mc.vy*=.5;
_mc.vx+=4;
_mc._x+=_mc.vx;
_mc._y+=_mc.vy;
}
图片跟随:
1.画好图片,调整好大小
2.在图片上写如下代码
onClipEvent (load) {
StartSize = 20;
MaxStep = 20;
SizeIncrement = 15;
for (var i = 1; i<=MaxStep; i++) {
duplicateMovieClip(Tail_mc, "Tail"+i, i);
with (eval("Tail"+i)) {
_xscale = StartSize+(i*SizeIncrement);
_yscale = StartSize+(i*SizeIncrement);
_alpha = 100-(100/MaxStep)*(i-1);
}
}
Tail_mc._visible = false;
}
onClipEvent (enterFrame) {
Tail1._x = _xmouse;
Tail1._y = _ymouse;
for (var i = 2; i<=MaxStep; i++) {
Temp = eval("Tail"+i);
Temp.xdistance = (eval("Tail"+(i-1))._x-Temp._x)/2+Temp.xdistance*0.3;
Temp.ydistance = (eval("Tail"+(i-1))._y-Temp._y)/2+Temp.ydistance*0.3;
Temp._x += Temp.xdistance;
Temp._y += Temp.ydistance;
}
}
- 1楼网友:有你哪都是故乡
- 2021-07-17 11:41