# Zoom Effect

**URL:** <https://forum.kirupa.com/t/zoom-effect/76210>\
**Category:** open source\
**Created:** [January 16, 2005, 4:33am UTC](https://forum.kirupa.com/t/zoom-effect/76210 "2005-01-16T04:33:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kirupa](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kirupa/32/11616_2.png) [@kirupa](https://forum.kirupa.com/u/kirupa)\
**Post date:** [January 16, 2005, 4:33am UTC](https://forum.kirupa.com/t/zoom-effect/76210/1 "2005-01-16T04:33:34Z")

</div>

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](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:

```auto
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:

```auto
for (var i = 0; i<25; i++) {
 circle.duplicateMovieClip(i, i);
}

```

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

Cheers!  
Kirupa :ninja:
