PDA

View Full Version : Zoom Effect


kirupa
01-16-2005, 12:33 AM
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:

Mik3
01-16-2005, 12:57 AM
cool, it reminds me of the intro to the song Such Great Heights by Death Cab for Cutie.

nobody
01-17-2005, 06:21 PM
Don'tcha mean The Postal Service t3h?

sky_vault
01-18-2005, 02:02 AM
Don'tcha mean The Postal Service t3h?xxxxxxxxxxxxxxxxxxxxxxxxxxxxx :thumb:

hl
02-13-2005, 09:54 PM
paparatsi(sp)!