View Full Version : Rotating Stars
icio
January 13th, 2006, 01:00 PM
Just a quick little thing that I was playing with it. It's very short indeed.
Mouse controls rotation speed along x-axis and alpha on y-axis.
Stage.scaleMode = "noScale";
var cols:Array = [0xC2F44D, 0xB0E84B, 0x9FDC49, 0x8DD047, 0x7BC445, 0x6AB843, 0x58AC41, 0x47A03F, 0x35943D, 0x23883B, 0x127C39, 0x007037];
var stars:Array = [_root.createEmptyMovieClip("star_1", _root.getNextHighestDepth())];
star_1.i = 0;
star_1._x = 275;
star_1._y = 200;
star_1.lineStyle(0, 0, 0);
star_1.beginFill(cols[0], 100);
star_1.moveTo(0, 15);
for (a=0, r=15; a<=Math.PI*2; a+=Math.PI*0.2, r = 12+(12-r)) {
star_1.lineTo(Math.cos(a)*r, Math.sin(a)*r);
}
for (i=1; i<10; i++) {
stars.push(_root.star_1.duplicateMovieClip("star_"+i, -i));
new Color(_root["star_"+i]).setRGB(cols[i%cols.length]);
_root["star_"+i].i = i;
_root["star_"+i]._xscale =_root["star_"+i]._yscale = (i+1)*100;
}
function onEnterFrame() {
for (i in stars) {
stars[i]._rotation += (stars[i].i+1)*(_xmouse-275)*0.005;
stars[i]._alpha = 250 - Math.abs(_ymouse-200)*stars[i].i*0.5;
}
}
kdd
January 13th, 2006, 01:07 PM
that's great! :)
kirupa
January 13th, 2006, 01:08 PM
Nice :)
Neil
January 13th, 2006, 06:42 PM
wicked man !!
PS - Finally I found my password... back to Kirupa after 1 year break :P
DDD
January 13th, 2006, 07:56 PM
man this is just damn awesome.......i love it.
icio
January 13th, 2006, 07:59 PM
Thank you very much, 3D.
J
January 14th, 2006, 01:34 AM
Cool :)
hybrid101
January 14th, 2006, 01:55 AM
sweet! green stars...
Sinister Shadow
January 14th, 2006, 05:46 AM
Funky!
McGiver
January 15th, 2006, 06:35 AM
I should be learning, instead I'm rotating your Brussels sprouts! lol
looks cool: Thums up :thumb2:
FlashTECHY
January 15th, 2006, 09:05 AM
dat's really Cool!
wht can u ask more in 25 lines Code!!!:D
thanks for sharing!!
icio
January 15th, 2006, 04:05 PM
Thanks, guys.
Sammo
January 15th, 2006, 04:33 PM
So simple, yet so clever, you got my vote. I love the little touches that allow the mouse to manipulate it, instead of just having a random (or not so) sequence.
icio
January 15th, 2006, 08:57 PM
:D Thanks
fabiopb
January 15th, 2006, 09:49 PM
i wish i could learn this stuff an easy way, i cannot seem to grasp te whole actionscript thing :upset:
NiñoScript
January 15th, 2006, 10:39 PM
there's no easy way, sorry... just read tuts and ask here in the kirupaforums ;)
McGiver
January 16th, 2006, 04:24 AM
if you prefer you can learn BF first, I heard there's even a compiler availible in flash ;) just kidding
icio
January 16th, 2006, 04:57 AM
LOL
fabiopb
January 16th, 2006, 05:30 AM
:shifty: lol
dbarbarian
January 16th, 2006, 12:49 PM
This is my favorite submission so far. The colors are very, very, well balanced. It also looks very organized and spurratic at the same time. Allowing for user control was also a very nice touch.
A simple idea. Excellent execution.Two thumbs up. :thumb: :thumb:
No wait, those are too small. :thumb2: :thumb2:
icio
January 16th, 2006, 01:07 PM
lol. Thanks very much. That means a lot to me, I really like your work too :thumb2:
Seb Hughes
January 16th, 2006, 01:13 PM
Wow that pwns :D
Sammo
January 16th, 2006, 02:12 PM
i wish i could learn this stuff an easy way, i cannot seem to grasp te whole actionscript thing :upset:
Buy a book, read the forums and experiment :)
pom
January 24th, 2006, 01:49 PM
I like the colors and the way it moves :)
SimplyArun
February 6th, 2006, 03:48 AM
I love it and as pom said the colors are awesome
mlk
February 6th, 2006, 06:22 PM
very nice !
Thanks to all of those who participated, reading all these code is a great way to understand AS!
logikal2
June 30th, 2006, 11:20 PM
amazing.
Qued
July 1st, 2006, 02:15 AM
awesome...
vega
July 14th, 2006, 08:32 AM
Awesome and inspiring..
I love the smooth transformations..very cool indeed. I have waayy long to go before coming up with anything even close but stuff like these will keep me wanting to learn more and more.:thumb2:
mnkeymasta
October 8th, 2006, 02:52 PM
Nice!:kommie::thumb2::party:
jasvarghese
November 20th, 2006, 09:00 AM
thats nice....
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.