Skip to main content
Xadap
Participant
September 24, 2014
Question

Zoom In/Out Button with Pan AS3

  • September 24, 2014
  • 3 replies
  • 1160 views

Good Day! I'm new to Flash AS3,

And I have a major problem on my project

What I've been doing is an Interactive map and some functions along with a zoom in/out and pan button

I've got the code on the zoom in/out button, problem is when there is no limitation when I zoomed it in(Still researching this)

Here is my code in the zoom in(I just change the + to - on the zoom out button ofc!)

     on(release){

     _root.SoilMap._xscale+=10;

     _root.SoilMap._yscale+=10;

     }

"I don't have any codes for the Pan Button yet"

...
What my final output would be this, in the Black line square that would be my limit in the zoom in/out , and that is the area where

I could only use my Pan button.

Any codes that is related to this would help me.

I've also research about the Javascript that can zoom/pan but it's only for JPG, i tried the SWF file but it didn't work.

This topic has been closed for replies.

3 replies

Xadap
XadapAuthor
Participant
September 24, 2014

What my final output would be like this

You could zoom it in and there's no limitationand on the black square that's the area where the pan button is only usable.

Xadap
XadapAuthor
Participant
September 24, 2014

And I edited that in paint, lol

Ned Murphy
Legend
September 24, 2014

I am not really clear on what you are having a problem with nor how panning fits in with it.  If you want to place a limit on the zooming then use a conditional to check if the current scaling is at a maximum allowed value or not...

     on(release){

        if(_root.SoilMap._xscale < whatever_the_limit_is){     // could also use width (or height)

             _root.SoilMap._xscale+=10;

             _root.SoilMap._yscale+=10;

        }

     }

Ned Murphy
Legend
September 24, 2014

That is AS2 code, not AS3.

I am moving this to the AS2 forum (ActionScript 1 and 2).  If you have further questions for this same project you should post them in that forum.  If I cannot help answer it I will remove this response so that your posting shows 0 replies - that attracts help

Xadap
XadapAuthor
Participant
September 24, 2014

oh, please do move it to (ActionScript 1 and 2) sorry I thought this was AS3.