PDA

View Full Version : Multilevel zooming w/ Actionscript?


moroten
03-31-2003, 10:26 AM
Hi,

I'k appreciate a few hints on how I should go about creating a multilevel zoomable map for a swedish real estate company. ((I'm new to actionscript, and I'm not asking anyone to code it for me, but some directions on what to go study and try out would be helpful, so i dont spend lots of time learning unrelated functions. Also, perhaps some things I'm asking for are impossible?))

The map should have perhaps 5 zoomlevels, from full country-level, through province-level to local area level. Spots that can be zoomed to are indicated with a button. Additional zoomlevels (perhaps onto specific houses or part of houses) could be added where needed.

For instance, lets say I want to check for houses in and around Stockholm. From all the zoombuttons in country-level, I click the province I want to go to. The map does a smooth, tweened zoom to that province and new "zoom here" icons fade in to let me continue to some specific part of the province, and further on down to a part of the city where available realestate exists. Here, I want a position-matched aerial shot image to fade in on top of the map.

All information about available buildings need to be database-driven so nobody will have to edit the swf. Info and images on specific houses and aerial shots need to be loaded only when necessary.

A prototype of the application can be found here:
http://213.212.11.156/nccflash/frameset_live.htm

You can only zoom in to one project, and the zoom is handtweened, but it gives an idea of what is needed and (hopefully) the combined lushness of smooth motion and our rendered images.

Many thanks in advance... hope I didnt confuse you all now.

-Daniel

Per-Anders
04-01-2003, 07:10 AM
well as always lots of ways to do this, but what i would do is make button that had an internal script on it's frames (this repeatable), that when clicked told the root timeline it's x and y co-ordinates as well as telling flash that it'sbeen clicked, the root timeline do some simple flash actionscript to animate the zoom and the move on the current movieclip and the one that the button should bring up using the co-ordiantes that the button gave. the button can send the x and y co-ords back simply by doing something like

_root.thexcoordiante=_x;
_root.theycoordiante=_y;
_root.clicked=myindex;

Anyhow have somethin in the root that goes:

if (clicked>0) {
...put in code to zoom in here...
}

hopw this gives you some ideas, good luck :)

DainBramaged
04-01-2003, 02:53 PM
Hmmmm.....

Off the top of my head, I would play around with the idea of defining a grid (in as, not an actual grid). Maybe start with your map zoomed all the way out to show everything. Then have the map divided into, oh, say 50 pixel increments. If they click within that gridsquare, zoom to that area, and have the function define the new grid on 20 pixels. Repeat the function for the grid and zoom, adjusting the grid increments on each zoom. (or maybe keep the same increments, depending on how tightly you need to define each area of the map).

You could also use the dynamic grid to define where the houses are, so you can load variables from a text file, referencing the grid location the house belongs to, and duplicate your marker clip for your houses, placing it on that grid location.

Just some thoughts. Good luck on this, whichever way you work it out.

Dain

CGTalk Moderation
01-14-2006, 07:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.