# Zooming- probably for the advanced of you

**URL:** https://forum.kirupa.com/t/zooming-probably-for-the-advanced-of-you/102138
**Category:** Uncategorized
**Created:** [February 20, 2004, 2:29am UTC](https://forum.kirupa.com/t/zooming-probably-for-the-advanced-of-you/102138 "2004-02-20T02:29:20Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Artom](https://avatars.discourse-cdn.com/v4/letter/a/bcef8e/32.png) [@Artom](https://forum.kirupa.com/u/Artom)
#### Post date: [February 20, 2004, 2:29am UTC](https://forum.kirupa.com/t/zooming-probably-for-the-advanced-of-you/102138/1 "2004-02-20T02:29:20Z")

</div>

hey guys,  
i always wondered how this effect is done…

let’s say on rollover your button (or text) zooms in and if you rollout really really fast (so it doesn’t reach the 100% percent of the zoomed-in state) it zooms out right back from the frame you left your button at. i think it’s better to show then explain… so please bear with me (i wish i had an example)

say you rollOver a button and it starts to zoom in (in slow mo) 10%, 20%, 30%, 40%, 50%, 60% and then you rollout and it goes down starting from how big it was when you rolled out …60%, 50%, 40%, 30%, 20% etc. so it doesn’t get sent to a 100% keyframe and then starts to get smaller.

share if you know how to get this done,  
thanks in advance,

Artom  
:bandit:

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 20, 2004, 7:16am UTC](https://forum.kirupa.com/t/zooming-probably-for-the-advanced-of-you/102138/2 "2004-02-20T07:16:45Z")

</div>

```auto
MovieClip.prototype.zoomInAndOut = function(n, s) {
	this.speed = s;
	this.scale = this._xscale;
	this.zoom = function(d, s) {
		this.onEnterFrame = function() {
			if ((this.scale>=100*n && d == 1) || (this.scale<=100 && d == -1)) {
				delete this.onEnterFrame;
			} else {
				this.scale += d*this.speed;
				this._xscale = this._yscale=this.scale;
			}
		};
	};
	this.onRollOver = function() {
		this.zoom(1);
	};
	this.onRollOut = function() {
		this.zoom(-1);
	};
};
my_movieclip.zoomInAndOut(3, 30);//value of the zoom (3 will make the movieclip 3 times bigger) , speed

```

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 21, 2004, 12:51am UTC](https://forum.kirupa.com/t/zooming-probably-for-the-advanced-of-you/102138/3 "2004-02-21T00:51:47Z")

</div>

Claudio,

Thanks for your help man!

Artom :thumb:

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 21, 2004, 12:59am UTC](https://forum.kirupa.com/t/zooming-probably-for-the-advanced-of-you/102138/4 "2004-02-21T00:59:44Z")

</div>

Glad I could help Artom 🙂

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 8, 2004, 6:52pm UTC](https://forum.kirupa.com/t/zooming-probably-for-the-advanced-of-you/102138/5 "2004-04-08T18:52:40Z")

</div>

> [@Supadiri](#):
>
> Grazie claudio hai aiutato anche me 😉  
> Thx Claudio you helped me too 😉
> 
> Cya!

Welcome 🙂

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 8, 2004, 8:31pm UTC](https://forum.kirupa.com/t/zooming-probably-for-the-advanced-of-you/102138/6 "2004-04-08T20:31:23Z")

</div>

New problem here ☹ :

> 

[http://www.kirupaforum.com/forums/showthread.php?p=479158#post479158](http://www.kirupaforum.com/forums/showthread.php?p=479158#post479158)

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 8, 2004, 9:02pm UTC](https://forum.kirupa.com/t/zooming-probably-for-the-advanced-of-you/102138/7 "2004-04-08T21:02:33Z")

</div>

Can someone tell me which part of this code goes on th mc and which part goes on the timeline/frame? Thanks
