当前位置: 移动技术网 > IT编程>UI设计>设计软件 > Flash AS特效:超绚丽的闪字动画

Flash AS特效:超绚丽的闪字动画

2019年03月23日  | 移动技术网IT编程  | 我要评论
  下午用了1个小时左右弄好的,刚完工,累啊...为了闪吧2008兴旺发展,请帮我顶此帖... 效果:按每个字都会动,按“闪”就可以拖动,后面的字跟随,放开“闪”后,又恢复原来的运动。



代码如下:
/*作者:梦自在*/
importmx.transitions.*;
importmx.transitions.easing.*;
varr:number=45;
varp:number=0;
vardrag:boolean=false;
varnum:number=0;
varname_array:array=newarray("闪","吧","2","0","0","8","兴","旺","发","展");
this.createemptymovieclip("container",this.getnexthighestdepth());
/*旋转*/
functionstart_func(){
for(vari:number=0;i<=9;i ){
container.attachmovie("ball","ball" i,i);
container["ball" i]._x=225 r*(math.abs(4.5-i))*math.cos((135-(math.floor((i/5))*180))*math.pi/180);
container["ball" i]._y=225 r*(math.abs(4.5-i))*math.sin((135-(math.floor((i/5))*180))*math.pi/180);
container["ball" i].txt.text=name_array[i];
container["ball" i].i=i;
container["ball" i].onenterframe=function(){
varmy_color:color=newcolor(this._mc);
my_color.setrgb(math.random()*0xffffff);
this._x=225 r*(math.abs(4.5-this.i))*math.cos(((135-(math.floor((this.i/5))*180)) p)*math.pi/180);
this._y=225 r*(math.abs(4.5-this.i))*math.sin(((135-(math.floor((this.i/5))*180)) p)*math.pi/180);
p=p 0.5;
};
container["ball" i].onpress=function(){
varmytween:tween=newtween(this,"_xscale",elastic.easeout,100,200,1,true);
varmytween:tween=newtween(this,"_yscale",elastic.easeout,100,200,1,true);
};
container["ball" i].onrelease=function(){
varmytween:tween=newtween(this,"_xscale",elastic.easeout,200,100,1,true);
varmytween:tween=newtween(this,"_yscale",elastic.easeout,200,100,1,true);
};
}
}
start_func();
/*拖动跟随*/
varmouselistener:object=newobject();
mouselistener.onmousedown=function(){
if(container["ball" 0].hittest(_root._xmouse,_root._ymouse)){
drag=true;
}
};
mouselistener.onmousemove=function(){
if(drag){
num=1;
deletecontainer["ball" 0].onenterframe;
container["ball" 0]._x=_root._xmouse;
container["ball" 0]._y=_root._ymouse;
for(vari:number=1;i<=9;i ){
deletecontainer["ball" i].onenterframe;
container["ball" i]._x =(container["ball" (i-1)]._x-container["ball" i]._x)/3;
container["ball" i]._y =(container["ball" (i-1)]._y-container["ball" i]._y)/3;
}
}
};
mouselistener.onmouseup=function(){
drag=false;
/*拖动后才能恢复*/
if(num==1){
start_func();
num=0;
}
};
mouse.addlistener(mouselistener);
源文件:闪吧2008兴旺发展.rar

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网