# Zooming in and out on an image (Flash5)

**URL:** <https://forum.kirupa.com/t/zooming-in-and-out-on-an-image-flash5/11964>\
**Category:** flash\
**Created:** [January 24, 2003, 5:29pm UTC](https://forum.kirupa.com/t/zooming-in-and-out-on-an-image-flash5/11964 "2003-01-24T17:29:24Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![ericinho](https://avatars.discourse-cdn.com/v4/letter/e/9dc877/32.png) [@ericinho](https://forum.kirupa.com/u/ericinho)\
**Post date:** [January 24, 2003, 5:29pm UTC](https://forum.kirupa.com/t/zooming-in-and-out-on-an-image-flash5/11964/1 "2003-01-24T17:29:24Z")

</div>

I want to zoom in and out on an image (it’s actually a thumbnale which pops up). Or if you want, to have a small image ‘grow’ to a larger format.

I tried it with scaling + tween, but it is hardly a smooth transition.

are there better ways of doing it (without manually adjusting each frame of the tween)?

---

<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:** [January 24, 2003, 5:33pm UTC](https://forum.kirupa.com/t/zooming-in-and-out-on-an-image-flash5/11964/2 "2003-01-24T17:33:20Z")

</div>

have you tried to increase you fps ? :bounce:

---

<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:** [January 24, 2003, 5:53pm UTC](https://forum.kirupa.com/t/zooming-in-and-out-on-an-image-flash5/11964/3 "2003-01-24T17:53:48Z")

</div>

i actually did a zoom once, and it worked out pretty good. here is what i did:

```auto

MovieClip.prototype.zoomIt = function() {
		if (_root.yourMCname._xscale>300) {
			clearInterval(intId);
		} else {
			_root.yourMCname._xscale = _root.yourMCname._xscale+5;
			_root.yourMCname._yscale = _root.yourMCname._yscale+5;
		}

```

then on the movie clip (MC) highlight it and go to actions  
and add this:

```auto

onClipEvent (load) {
	intId = setInterval(zoomIt, 100);
}

```

hope this helps.

---

<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:** [January 24, 2003, 6:58pm UTC](https://forum.kirupa.com/t/zooming-in-and-out-on-an-image-flash5/11964/4 "2003-01-24T18:58:54Z")

</div>

yes, that is a good script way, as there are several others.  
But what got my attention was the smooth part:

> I tried it with scaling + tween, but it is hardly a smooth transition.

that is only fixed with fps increase.

---

<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:** [January 24, 2003, 7:03pm UTC](https://forum.kirupa.com/t/zooming-in-and-out-on-an-image-flash5/11964/5 "2003-01-24T19:03:10Z")

</div>

yes you are right fps is the best way to get a smooth animation.

---

<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:** [January 24, 2003, 7:21pm UTC](https://forum.kirupa.com/t/zooming-in-and-out-on-an-image-flash5/11964/6 "2003-01-24T19:21:50Z")

</div>

and you got a nice code there. 😉 you made it?

---

<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:** [January 24, 2003, 9:51pm UTC](https://forum.kirupa.com/t/zooming-in-and-out-on-an-image-flash5/11964/7 "2003-01-24T21:51:01Z")

</div>

thanks for the code, I will try that.

about the fps.

I am currently running the anim at 24fps and for the main I want to keep that.

If I load an external SWF onto the main, will the SWF keep its own (and faster) FPS, or will it adapt to the framerate of the main swf?

---

<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:** [January 24, 2003, 9:56pm UTC](https://forum.kirupa.com/t/zooming-in-and-out-on-an-image-flash5/11964/8 "2003-01-24T21:56:04Z")

</div>

24 fps is good!

and, no. the loaded swf will be with the same fps as the main.

---

<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:** [January 25, 2003, 7:09am UTC](https://forum.kirupa.com/t/zooming-in-and-out-on-an-image-flash5/11964/9 "2003-01-25T07:09:29Z")

</div>

You can chage frame rate using AS.

---

<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:** [January 25, 2003, 4:24pm UTC](https://forum.kirupa.com/t/zooming-in-and-out-on-an-image-flash5/11964/10 "2003-01-25T16:24:07Z")

</div>

but will affect all movies, main included. [SIZE=1]i think :-[/SIZE]

---

<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:** [January 26, 2003, 8:43am UTC](https://forum.kirupa.com/t/zooming-in-and-out-on-an-image-flash5/11964/11 "2003-01-26T08:43:54Z")

</div>

thanks all.

i don’t think the fps is the problem, but the scaling of the image.

---

<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:** [January 26, 2003, 9:28am UTC](https://forum.kirupa.com/t/zooming-in-and-out-on-an-image-flash5/11964/12 "2003-01-26T09:28:55Z")

</div>

fps = smoothnes

unless you did something very wrong :-\ if you can post your fla here i´ll take a look at it 🙂
