Map controls

i am making a virtual tour for which i want to have the ability to control the map with buttons. i want to be able to zoom, pan, center and switch floors. i have the code figured out for all of those thanks to everyone who helped with the “object control” threads however i have run into a new problem for which i am in need of the groups expertise once again.

here it is:

the pan works fine within the bounds as does the zoom within its bounds … as one would expect … the problem comes, however, when i want the zoom and pan to interact. when a user zooms in on the map i would like them to be able to pan around it and with the bounds set as static values when the movie clip enlarges (zooms in) its already over those values so it does not move.

my question is can i set a dynamic variable that will define the bounds by which the map is constrained in its movement?

my code currently looks like this

on (press, keyPress “<Up>”) {
if (map.one._y<-125+map.one._height/2) {
map.one._y -= 10;
}
}


i would like to change it to something like the following


on (press, keyPress “<Up>”) {
if (map.one._y<mapwidth+map.one._height/2) {
map.one._y -= 10;
}
}


zbounds would equal the value _width or _height respectively.

how can i do this? please post an example if possible.

thanks so much

I am not sure how you got your bounds. I would suggest that perhaps you did not use getBounds. If you use getBounds, you would get that “dynamic” effect that you’re talking about.

I’ve just took some time to draw a full vector map, oh the long hours!! I’ve masked the thing and made myself some buttons for panning and zooming. I’ve given buttons very simple instance names (up, down, left, right, in and out). Now I come to the part I really hate, ActionScript.

Are there any examples you have or might know about so I can learn how to make my map zoom and pan? I will be very grateful if you could help…

theres another thread i posted on here called “object controls” there are example files in there … i’d post it again but i’m not at work so i don’t have the files. it should still be on the forum though.

hope that helps.

http://www.kirupaforum.com/showthread.php?s=&threadid=1448

You’re a gentleman and a scholar as we say “up north”, thank you very much.

thx inigo for the link and thx for the kind words clark.

let us know if you need anymore help figuring out the controls.