PDA

View Full Version : zooming on a jpg


sralok
08-05-2002, 04:41 PM
I don't know how difficult this is but I am a newbie at flash. I need to zoom in and out on a jpg in a constricted box outline. The image isn't going to be any bigger than 1024 x 768 and any smaller than 550 x 375. I am including buttons to press to do so with a zoom out button and a zoom in button.

Wimpyburger
08-05-2002, 05:26 PM
you could scale the picture, for zooming

zoombutton:
on(press) {
picture._xscale+=5;
picture._yscale+=5;
}

dezoombutton:
on(press) {
picture._xscale-=5;
picture._yscale-=5;
}

you could add limitations to the zooming scale with if...else conditions.

DiDi
08-05-2002, 05:29 PM
Simple search for "zoom" at FlashKit movies database gave more then 50 results:

http://www.flashkit.com/search.php?cat=movies&field=Description&per=10&page=1&term=zoom&x=30&y=8

You even have 5 examples that can help you here at as.org movies section.

Try to do simplest and most logic things (like search) and then post if you have a specific question...


Hope this helps...

DD

Abelius
08-05-2002, 05:37 PM
Wimpyburger's simple solution for the problem is great, although it would certainly not render the zoom in as a centered body. But the idea works...

Obviously, (and as usual) DiDi's link is probably the better choice... :)

sralok
08-05-2002, 07:40 PM
Thanks for the help. Now my problem is I can't figure out why my max and min limitations won't work. I used red penquins example here
http://www.actionscripts.org/forums/showthread.php3?s=&threadid=9650
but it just blows my mind why the limitations won't work

farafiro
08-06-2002, 10:59 AM
why don't u tray a lopoonEnterFrame = function(){
for(x = 0;x<800;x+=10){
_root.mc._xscale = _root.mc._xscale =x
}
trace(x)
}

sralok
08-06-2002, 02:35 PM
Thanks but I just solved my simple problem I just said

on (release) {
// zoom out
if (zoom._xscale <=100) {
zoom._xscale += 2;
zoom._yscale += 2;

instead of a max or min set

Thanks again for the help