PDA

View Full Version : Spiraling Stars



freeskier89
January 13th, 2006, 04:33 PM
He is my first submission :D. I will probably have more updates on it soon. Currently, it is 24 lines.

Stage.scaleMode= "noScale";
function CreateCircle(Name,width){
_root.depthvar++
mc = _root.createEmptyMovieClip (Name,depthvar);
mc.lineStyle(width/4,0x5797D7,30);
mc.beginFill(0x48BCE1,50);
for(var t=0;t<360;t+=10){
if(t!=0) mc.lineTo((width*.75+width*.25*Math.sin(t*5*Math.P I/180))*Math.cos(t*Math.PI/180),(width*.75+width*.25*Math.sin(t*5*Math.PI/180))*Math.sin(Math.PI/180*t));
else mc.moveTo((width*.75+width*.25*Math.sin(t*5*Math.P I/180))* Math.cos(t*Math.PI/180),(width*.75+width*.25*Math.sin(t*5*Math.PI/180))*Math.sin(Math.PI/180*t));
}
mc.endFill();
return mc;
}
MovieClip.prototype.FollowPoint=function(x,y){
this._x= this._x+(x-this._x)/5;
this._y= this._y+(y-this._y)/5;
}
onEnterFrame=function(){
dist=Math.sqrt((_xmouse-mc0_0._x)*(_xmouse-mc0_0._x)+(_ymouse-mc0_0._y)*(_ymouse-mc0_0._y));
angle+=5;
d<70 ? d=70 : d=dist/1.4;
nodesToFollow = [[_xmouse+d* Math.cos(angle*Math.PI/180) , _ymouse+d*Math.sin(angle*Math.PI/180)],[_xmouse+d*Math.cos((angle+120)*Math.PI/180) , _ymouse+d*Math.sin((angle+120)*Math.PI/180)],[_xmouse+d*Math.cos((angle+260)*Math.PI/180) , _ymouse+d*Math.sin ((angle+260)*Math.PI/180)]];
}
for(var n=0;n<3;n++){
mc = CreateCircle("mc"+n+"_0");
mc.n=n;
mc.onEnterFrame=function(){
this.FollowPoint(nodesToFollow[this.n][0],nodesToFollow[ this.n][1]);
}
for(var n2=0;n2<10;n2++){
mc2=CreateCircle("mc"+n+"_"+(n2+1),20);
mc2.FollowMc=_root["mc"+n+"_"+n2];
mc2._alpha=mc2._xscale=mc2._yscale=(7-n2)*(100/7)
mc2.onEnterFrame = function(){
this._rotation=angle;
this.FollowPoint(this.FollowMC._x,this.FollowMC._y );
}
}
}


Please let me know what you think!
-freeskier89 :)

kirupa
January 13th, 2006, 04:45 PM
Very nice :)

kdd
January 13th, 2006, 04:59 PM
very "kool" :)

Nikaosky
January 13th, 2006, 06:02 PM
Great stuff Freeskier!

icio
January 13th, 2006, 06:17 PM
Nice :)

Seb Hughes
January 13th, 2006, 06:25 PM
Sweet

virusescu
January 13th, 2006, 07:07 PM
That's awesomeeeee.

me.createSomethingNew(now);

freeskier89
January 13th, 2006, 08:17 PM
Thanks everyone! :) It is now 25 lines (added Stage.scaleMode="noScale")

boohaha
January 13th, 2006, 08:18 PM
Smooooth!!!

hybrid101
January 14th, 2006, 01:45 AM
wow, nice effect!!!

Sinister Shadow
January 14th, 2006, 05:47 AM
Wow!

Sammo
January 14th, 2006, 07:24 PM
Really really nice effect.

Just curious here, but isn't:

width*.75+width*.25 exactly the same as
width?

Sinister Shadow
January 14th, 2006, 07:35 PM
:lol:

freeskier89
January 14th, 2006, 08:43 PM
Really really nice effect.

Just curious here, but isn't:
ActionScript Code:

width*.75+width*.25



exactly the same as ActionScript Code:

width



?:lol: yes it is, but in my case it isn't because there is a multiplicative operation following "width*.75" ( Math.cos(...) . Kind of like:

a*.75+a*.25*3 != a*3

if width*.25 + width*.75 was in parenthesis, you would be right.

TheCanadian
January 14th, 2006, 11:38 PM
I said it once and I'll say it again, very nice :thumb:.

McGiver
January 15th, 2006, 06:25 AM
yeah looks cool and smooth :love:

ahmed
January 15th, 2006, 03:07 PM
wow

SimplyArun
February 6th, 2006, 03:54 AM
Awesome!