Skip to main content
Thomas Hanser
Inspiring
March 30, 2014
Question

Zoom & Pan

  • March 30, 2014
  • 1 reply
  • 703 views

I have a new project at work that I want to improve the interactivity on. Let's say I have a country map with icon-buttons representing cities.

Click on a button, and you zoom in and pan across to that city, close up.  (Not unlike searching on Google maps.)  A talkbox of information appears, including a X close button, which would return you to the zoomed out and centered state or position. 

How can I do this?

I imagined using different MC's, placed on frames across the timeline. Click on a button, go to frame _ and play the MC.  The MC would include the zoom in and pan (transform scale and position).

But what if I could use Flash "math" to zoom directly into the city, not MC involved?  How do I script that?

Anyone?

Thanks so much.

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
March 30, 2014

i think that would be easier and more satisfactory to use code instead of timeline frames.  each city could be a child movieclip (transparent works, too) of the main map parent.

when a you want to zoom and/or pan to a city, you would determine how much its x and y need to change to center it on-stage.  you would then apply that transform to its parent map.

Thomas Hanser
Inspiring
March 30, 2014

Great, and I agree.

Care to elaborate?  Or maybe direct me to a script library somewhere?

I'm currently looking here:

http://www.flashandmath.com/

I'll search for parent and child techniques, which I've never done yet. 

Thanks again.

kglad
Community Expert
Community Expert
March 31, 2014

if you want to hire me to help send an email via http://www.kglad.com > contact

for free help continue posting here. 

if you're willing to try this yourself and hit specific snags, you should be able to complete this with free help here.