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)!

bugiam
10-05-2005, 06:30 AM
i want to use this in the bg of a logo i'm building, how do i mask this thing? :)

danielson
10-05-2005, 07:29 AM
i want to use this in the bg of a logo i'm building, how do i mask this thing? :)

Stick the whole lot in an empty movie clip (instead of putting it on the root timeline) then, back on the root timeline, mask the layer that this movie clip is on.

manishjain
05-09-2007, 01:51 PM
Can you tell me the details instruction how to use this into any environment.

Thanks.

Manish Jain

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:ActionScript Code:
onClipEvent (load) {</p>
<p> this._x = Math.round(Math.random()*550);</p>
<p> this._y = Math.round(Math.random()*120);</p>
<p> this._xscale = this._yscale = Math.round(Math.random()*50);</p>
<p> this._alpha = 0;</p>
<p> x = -10;</p>
<p> n = 0;</p>
<p> speed = Math.round(.1+Math.random() * 2);</p>
<p>}</p>
<p>onClipEvent (enterFrame) {</p>
<p> if (x<10) {</p>
<p> num = -(Math.pow(x,2))+100;</p>
<p> n++;</p>
<p> x += speed;</p>
<p> this._alpha = num/(1.5*speed);</p>
<p> this._xscale = this._yscale=(num*speed);</p>
<p> if (n==((10/speed)*2)) {</p>
<p> n = 0;</p>
<p> this._x = Math.round(Math.random()*550);</p>
<p> this._y = Math.round(Math.random()*120);</p>
<p> this._xscale = this._yscale = Math.round(Math.random()*50);</p>
<p> speed = Math.round(.5+Math.random() * 2);</p>
<p> }</p>
<p> } else {</p>
<p> x = -10;</p>
<p> }</p>
<p>}



The code on the first frame:ActionScript Code:
for (var i = 0; i<25; i++) {</p>
<p> circle.duplicateMovieClip(i, i);</p>
<p>}



The attached source file (MX) contains the same as above.

Cheers!
Kirupa :ninja:

manishjain
05-10-2007, 11:40 AM
Hello,

Can you please provide me how to use this into any envieonment. I really need this to work into my environment. I have HTML and PHP code.

Waiting for your reply ASAP on mkjain@hotmail.com.

Thanks.

Manish Jain

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:ActionScript Code:
onClipEvent (load) {</p>
<p> this._x = Math.round(Math.random()*550);</p>
<p> this._y = Math.round(Math.random()*120);</p>
<p> this._xscale = this._yscale = Math.round(Math.random()*50);</p>
<p> this._alpha = 0;</p>
<p> x = -10;</p>
<p> n = 0;</p>
<p> speed = Math.round(.1+Math.random() * 2);</p>
<p>}</p>
<p>onClipEvent (enterFrame) {</p>
<p> if (x<10) {</p>
<p> num = -(Math.pow(x,2))+100;</p>
<p> n++;</p>
<p> x += speed;</p>
<p> this._alpha = num/(1.5*speed);</p>
<p> this._xscale = this._yscale=(num*speed);</p>
<p> if (n==((10/speed)*2)) {</p>
<p> n = 0;</p>
<p> this._x = Math.round(Math.random()*550);</p>
<p> this._y = Math.round(Math.random()*120);</p>
<p> this._xscale = this._yscale = Math.round(Math.random()*50);</p>
<p> speed = Math.round(.5+Math.random() * 2);</p>
<p> }</p>
<p> } else {</p>
<p> x = -10;</p>
<p> }</p>
<p>}



The code on the first frame:ActionScript Code:
for (var i = 0; i<25; i++) {</p>
<p> circle.duplicateMovieClip(i, i);</p>
<p>}



The attached source file (MX) contains the same as above.

Cheers!
Kirupa :ninja: