Search  

ZOOM TO PICTURE

HomeBrowse CategoriesFlashApplications and UtilitiesUtilitiesZoom To Picture

Dynamicly loads an image, then you can zoom in/out to the image with mouse wheel and you can pan with left mouse button.

Used AS2 .

PS: I can send you the Flash 8 version of the file, if you send me a message.

Posted about 1 year ago
Sorry, but It _does'nt_ works on a mac, I cant zoom. So people with a mac can't zoom...
Posted about 1 year ago

The one thing to make this better would be to be able to scroll around using the thumbnail picture bit as well. Same as you can in Photoshop or Google Maps.

Posted about 1 year ago

To make it work with +/- buttons for zoom, find:


mouse.onMouseWheel = function(delta){ if(delta<0){ if(base.picBase._width > base.pMask._width && base.picBase._height > base.pMask._height){

base.picBase._xscale -= 10;
        base.picBase._yscale -= 10;
        base.picBase._x += (base.picBase._width/base.picBase._xscale10)/2;
        base.picBase._y += (base.picBase._height/base.picBase._yscale10)/2;    
        base.pThumb.pThumbFrame._width = base.pMask._width/base.picBase._widthtWidth;
        base.pThumb.pThumbFrame._height = base.pMask._height/base.picBase._heighttHeight;
        if(base.picBase._x + base.picBase._width < base.pMask._width){
            base.picBase._x = base.pMask._width - base.picBase._width;
            base.pThumb.pThumbFrame._x = base.pThumb._width - base.pThumb.pThumbFrame._width;
            }
        if(base.picBase._y + base.picBase._height < base.pMask._height){
            base.picBase._y = base.pMask._height - base.picBase._height;
            base.pThumb.pThumbFrame._y = base.pThumb._height - base.pThumb.pThumbFrame._height;
            }
        if(base.picBase._x > 0){
            base.picBase._x = 0;
            }
        if(base.picBase._y >
           0){
            base.picBase._y = 0;
            }
        tFormat(base);
        }
    }else{
        base.picBase._xscale += 10;
        base.picBase._yscale += 10;
        base.picBase._x -= (base.picBase._width/base.picBase._xscale10)/2;
        base.picBase._y -= (base.picBase._height/base.picBase._yscale10)/2;
}
base.pThumb.pThumbFrame._width = base.pMask._width/base.picBase._widthtWidth;
    base.pThumb.pThumbFrame._height = base.pMask._height/base.picBase._heighttHeight;
    tFormat(base);
}

And replace with:

function getKeyPressed():String { var theKey:String; switch (Key.getAscii()) { case Key.BACKSPACE : theKey = “BACKSPACE”; break; case Key.SPACE : theKey = “SPACE”; break; default : theKey = chr(Key.getAscii()); } return theKey; } someListener = new Object();

mouse.onMouseWheel = someListener.onKeyDown = function(delta){
    if(delta<0 or getKeyPressed() == "-"){
        if(base.picBase._width > base.pMask._width && base.picBase._height > base.pMask._height){
base.picBase._xscale -= 10;
        base.picBase._yscale -= 10;
        base.picBase._x += (base.picBase._width/base.picBase._xscale10)/2;
        base.picBase._y += (base.picBase._height/base.picBase._yscale10)/2;    
        base.pThumb.pThumbFrame._width = base.pMask._width/base.picBase._widthtWidth;
        base.pThumb.pThumbFrame._height = base.pMask._height/base.picBase._heighttHeight;
        if(base.picBase._x + base.picBase._width < base.pMask._width){
            base.picBase._x = base.pMask._width - base.picBase._width;
            base.pThumb.pThumbFrame._x = base.pThumb._width - base.pThumb.pThumbFrame._width;
            }
        if(base.picBase._y + base.picBase._height < base.pMask._height){
            base.picBase._y = base.pMask._height - base.picBase._height;
            base.pThumb.pThumbFrame._y = base.pThumb._height - base.pThumb.pThumbFrame._height;
            }
        if(base.picBase._x > 0){
            base.picBase._x = 0;
            }
        if(base.picBase._y >
           0){
            base.picBase._y = 0;
            }
        tFormat(base);
        }
    }else if(delta>0 or getKeyPressed() == "+"){
        base.picBase._xscale += 10;
        base.picBase._yscale += 10;
        base.picBase._x -= (base.picBase._width/base.picBase._xscale10)/2;
        base.picBase._y -= (base.picBase._height/base.picBase._yscale10)/2;
}
Key.addListener(someListener);
base.pThumb.pThumbFrame._width = base.pMask._width/base.picBase._widthtWidth;
    base.pThumb.pThumbFrame._height = base.pMask._height/base.picBase._heighttHeight;
    tFormat(base);
}
Posted about 1 year ago

Hello

Ive got a map that i want to use this on, however the map has its own navigation, similar to that of the site linked below

http://www.chromazone-imaging.co.uk/flashindex.html

as the mouse moves the movie clip moves so the dragging function deosnt have to be used, Will the rest of the coding work if i take out the dragging function ?

Cheers for your help.

Posted about 1 year ago

Good stuff. I changed it up a bit so that the mousewheel zooms into where the pointer is as opposed to the center of the display area. Also make sure you apply all the catch-all if statements both when zooming in and when zooming out so that the picture doesn’t get placed outside of the display area. Code snippets below if anyone’s interested:

// zooming out
base.picBase._xscale /= 1.10;
base.picBase._yscale /= 1.10;

base.picBase._x = base.pMask._width/2 - _xmouse/1.10 + base.picBase._x/1.10;
base.picBase._y = base.pMask._height/2 - _ymouse/1.10 + base.picBase._y/1.10;

//zooming in
base.picBase._xscale *= 1.10;
base.picBase._yscale *= 1.10;
base.picBase._x = base.pMask._width/2 - _xmouse*1.10 + base.picBase._x*1.10;
base.picBase._y = base.pMask._height/2 - _ymouse*1.10 + base.picBase._y*1.10;
Posted about 1 year ago

I just purchased this file, but it won’t open on Mac or Pc for me. I tried it on Flash 8 on Mac and PC, and Flash 2004 on the Mac. Can you help me out?

Posted about 1 year ago

No worries, got it to work in cs3.:)

Posted about 1 year ago

could you please save this in flash 8 and email it to me? It doesn’t say that its only for CS3 . Mike@virtual3dinc.com Thank you.

Posted about 1 year ago

Nice file.

Posted about 1 year ago

Hi I’m trying to use it with a very huge image (30400w2368h) at 72dpi, yes…I know it’s very big.

The problem is that something cuts away de image and I can navigate only trough a “small” part of it. I think it’s de mask set. Is there any way to set the mask and averything to the real image size?

Thnx for helping…it’s an emergency.*

Posted about 1 year ago

Hi I’m trying to use it with a very huge image (30400w X 2368h) at 72dpi, yes…I know it’s very big.

The problem is that something cuts away the image and I can navigate only trough a “small” part of it. I think it’s de mask set. Is there any way to set the mask and averything to the real image size or to any size?

Thnx for helping…it’s an emergency.

Posted about 1 year ago

There is a limitation for bitmaps’ sizes on Flash. Width and height values can’t be higher than 2880px. I tried to find a solution for this but I couldn’t find anything.

Posted about 1 year ago

:’( snif!, snif! thnx anyway dude. If I find a solution I’ll let u know.

Posted about 1 year ago

Has anyone got this working with the +/- buttons? I’ve tried but not had any success yet – can anyone help?

Posted about 1 year ago

Sorted!

Posted about 1 year ago

Hello Lynch,

Please could you send me the Flash 8 file to igarstang@idoleyez.co.uk as soon as you can.

Thanks in advance.

Ian

Posted 10 months ago

is there a way to control the intial postion of the scroll (I have a image I want to start at the bottom)

Posted 8 months ago

@pixel_pusha: This requires a little modification. I can make that and send you file if you send me the original file.

Posted 8 months ago

I would like to use this in an existing ActionScript3 program. Just what is delivered? A .as file? Or just what? Thanks.

Posted 7 months ago

will it work on a movieclip as well?

Posted 7 months ago

@gambit: You can’t use this in a AS3 project.

Posted 6 months ago

@learnzone: It’s already working on a movieclip.

Posted 6 months ago

Is it possible to navigate through the small window only? I want the user to be able to navigate a map using the smaller window and be able to click on sections (hotspots) of the bigger map…

Thanks

Posted 4 months ago

how to use this file with mac mouse?

Posted 4 months ago

sorry …. resolved

Posted 4 months ago

I try this code below, but don´t work, someone can send me this file with buttons +/-, not mouse scroll? please?

aula.finalprint@terra.com.br">paula.finalprint@terra.com.br

Posted 4 months ago

Hi, love the mouse image with user hints. Having a bit of trouble with the modifications to make it zoom on the the pointer position rather than the center (as the post above) Is there a full code version with the modifications? Will there be a AS3 version?

Thanks James

Posted 3 months ago

hi how can i use the mouse wheel until the image size become 100% not more ?

Posted 2 months ago

Nice zoom effect, thanks I would like to add 2 buttons to help Mac people to zoom… Is it possible ?

Thanks Patrice

Posted about 1 month ago