Zooming in and out on an image (Flash5)

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)?

have you tried to increase you fps ? :bounce:

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


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:


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


hope this helps.

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.

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

and you got a nice code there. :wink: you made it?

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?

24 fps is good!

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

You can chage frame rate using AS.

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

thanks all.

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

fps = smoothnes

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