Hey everyone,
This is an effect seen on the home page and the various section pages on the site. Rab asked about a tutorial about it here, http://www.kirupa.com/forum/showthread.php?t=82207, so I figure I’ll provide the source file for it now and a tutorial for it when I have more time.
The code on the movie clip:
onClipEvent (load) {
this._x = Math.round(Math.random()*550);
this._y = Math.round(Math.random()*120);
this._xscale = this._yscale = Math.round(Math.random()*50);
this._alpha = 0;
x = -10;
n = 0;
speed = Math.round(.1+Math.random() * 2);
}
onClipEvent (enterFrame) {
if (x<10) {
num = -(Math.pow(x,2))+100;
n++;
x += speed;
this._alpha = num/(1.5*speed);
this._xscale = this._yscale=(num*speed);
if (n==((10/speed)*2)) {
n = 0;
this._x = Math.round(Math.random()*550);
this._y = Math.round(Math.random()*120);
this._xscale = this._yscale = Math.round(Math.random()*50);
speed = Math.round(.5+Math.random() * 2);
}
} else {
x = -10;
}
}
The code on the first frame:
for (var i = 0; i<25; i++) {
circle.duplicateMovieClip(i, i);
}
The attached source file (MX) contains the same as above.
Cheers!
Kirupa :ninja: