# MC scaling

**URL:** <https://forum.kirupa.com/t/mc-scaling/115586>\
**Category:** Uncategorized\
**Created:** [July 9, 2004, 8:39pm UTC](https://forum.kirupa.com/t/mc-scaling/115586 "2004-07-09T20:39:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajeanne26](https://avatars.discourse-cdn.com/v4/letter/a/8491ac/32.png) [@ajeanne26](https://forum.kirupa.com/u/ajeanne26)\
**Post date:** [July 9, 2004, 8:39pm UTC](https://forum.kirupa.com/t/mc-scaling/115586/1 "2004-07-09T20:39:07Z")

</div>

Hi I’m trying to modify the code below.  
I have two movieclips on the stage.

When you rollover the mc I want it to scale and zoom back to original size on mouse out.  
When you click on it I want it to stay scaled.  
When you rollover another mc I want the mc that was scaled to zoom back to it’s original size.

```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);
};
this.onClick = function() {
this.scale(100);
};
};
a.zoomInAndOut(1.5, 10);
//value of the zoom (3 will make the movieclip 3 times bigger) , speed
b.zoomInAndOut(1.5, 10);

```

Can someone help me modify this script?  
thanks in advance
