Groups | Blog | Home
all groups > flash actionscript > april 2004 >

flash actionscript : help with interactive map


garroyo
4/28/2004 10:22:55 PM
I?m trying to build a flash page that locates printers in a building. I have a
map of the building that is broken up into zones. I want user to click on a
zone to zoom into it and display the printers. From there they will click on
the printer they want to print to. There will be several Zones for them to
choose from.

My idea was to start with the building map in one layer and place a copy of
each zone on top of the map as a button in new layers. I then figured I could
add some action script

for example:

on (release){
gotoAndPlay(2)
}

that would go to a frame when one of the zone buttons are clicked and play
several frames of that Zone zooming in as a graphic via a motion tween. (sorry
if that didn?t make sense.) That?s about as far as I have gotten.

this sorta works, but not exactly and it returns an error.

**Error** Symbol=Tween 2, layer=Layer 1, frame=1:Line 1: Statement must appear
within on handler
gotoAndPlay(1);

Total ActionScript Errors: 1 Reported Errors: 1

I could use some help. I don?t know if I am on the right track or completely
lost.
mandingo
4/29/2004 1:06:03 AM
this is an error generated where you have placed AS code directly onto a
movieClip instance... in this case, your gotoAndPlay behaviour

move it onto the main timeline in a seperate actions layer

hope this helps
cheers,
garroyo
4/29/2004 3:33:06 PM
I wish that were true in this case.

BarneyK
4/29/2004 4:14:51 PM
I'm also building an interactive map! I think Flash is a really good tool for
them. If I were you I would have just one map that contains all of the printers
and resize and positon it when someone clicks on a zone. When they click on a
certain zone increase the size of the movie clips using the setInterval
function increasing the height and width of the movie clip by an incremental
amount. You can use the setInterval to do this a number of times until the
correct size has been reached. You can also reposition the map as you do this
changing the _x and _y properties so it moves to the correct area. Further to
this you can place a mask over the top of it so that the user cannot see the
whole map as it grows bigger but only a defined area. It does work well doing
it this way a good example is at:


[L=null]http://www.thebanmappingproject.com/atlas/index.html[/L]

Hope this helps
garroyo
4/29/2004 4:50:04 PM
I like that idea much better. Do you know where I could find a little more
help on how to set something like that up? I looked up and read about the
setInterval function, but could use more help then that. Any additional
assistance or direction would be appreciated.
BarneyK
4/30/2004 8:01:55 AM
I have attached a MX fla which should start you off. It is very simple as I am
short on time but it gives you an idea of how to set up a 'dynamic' zoom. It
does only enlarge the movie it does not position it but the principle is the
same for changing the x and y coordinates in the zoom function. Just click on
the movie clip to enlagre the movie.
Hope this starts you off on the right track.
garroyo
4/30/2004 4:06:11 PM
I tried the link to the zip but I get a 404 error:

"The page you are looking for might have been removed, had its name changed,
or is temporarily unavailable."

Thank you so much for offering this file. I am sure it will help me. I hope
we can find another way to get it across.
garroyo
5/1/2004 3:23:24 PM
AddThis Social Bookmark Button