代码如下:
/*作者:梦自在*/
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
IT时代网(关注微信公众号ITtime2000,定时推送,互动有福利惊喜)所有原创文章版权所有,未经授权,转载必究。
创客100创投基金成立于2015年,直通硅谷,专注于TMT领域早期项目投资。LP均来自政府、互联网IT、传媒知名企业和个人。创客100创投基金对IT、通信、互联网、IP等有着自己独特眼光和丰富的资源。决策快、投资快是创客100基金最显著的特点。
小何
小何
小何
小何