# 'zoom in' through a code?

**URL:** <https://forum.kirupa.com/t/zoom-in-through-a-code/17733>\
**Category:** flash\
**Created:** [April 8, 2003, 6:55pm UTC](https://forum.kirupa.com/t/zoom-in-through-a-code/17733 "2003-04-08T18:55:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![amhutap](https://avatars.discourse-cdn.com/v4/letter/a/8797f3/32.png) [@amhutap](https://forum.kirupa.com/u/amhutap)\
**Post date:** [April 8, 2003, 6:55pm UTC](https://forum.kirupa.com/t/zoom-in-through-a-code/17733/1 "2003-04-08T18:55:36Z")

</div>

Hi,

I apologize in advance if any of this sounds stupid. i am wondering if there is an intelligent way of creating a ‘zoom in’ effect which will can be handled and created within action script, rather than making ‘tween’ effect for each image on the time line.

please help,  
thankz

---

<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 17, 2003, 3:54pm UTC](https://forum.kirupa.com/t/zoom-in-through-a-code/17733/2 "2003-04-17T15:54:46Z")

</div>

I have just found out a way of doing it, it is done by putting the following code on a movieclip:

```auto

onClipEvent(load) {
_width=200;
_height=200;
}

```

Experience with the above code. On the last keyframe put:

```auto

stop();

```

unless you want it to loop.

---

<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 18, 2003, 3:16am UTC](https://forum.kirupa.com/t/zoom-in-through-a-code/17733/3 "2003-04-18T03:16:30Z")

</div>

try this…  
make a 40x40 rectangle on convert it to movieclip, put this on the rect MC…

```auto
//i use it on 40X40 rectangle MC
onClipEvent (load) {
	zoom = 100;
	minScale = this._height;
	maxScale = this._height+zoom;
	speed = 10;
}
on (press) {
	this.onEnterFrame = function() {
		_width += speed;
		_height += speed;
		if (_width && _height>=maxScale) {
			_width = _height=maxScale;
			delete (this.onEnterFrame);
		}
	};
}
on (release, releaseOutside) {
	this._width = this._height=minScale;
	delete (this.onEnterFrame);
}

```

hope that helps…🙂
