How to properly code a pan & zoom function
I am using Adobe Flash Professional CS5, and Actionscript 1&2.
I'm making a map that has tooltips pop-up when you hover over various areas... I'm very much a newbie, and I'm trying to teach myself flash as I make this rather complicated project... so please bear with me.
I want to be able to zoom in on the map, and then, once zoomed in, to be able to pan around the map by dragging (like a Hand Tool). However, I've encountered some problems, as I have no idea whatsoever how to properly do either of those things.
For the zooming, I put a button in either corner: a zoom out icon, and a zoom in icon. For the zoom-in icon, I used the code
on (rollOver){
setProperty ("BG", _xscale, "200");
setProperty ("BG", _yscale, "200");
}
(BG being the name of the instance used for the background of the map, which is a movie clip.)
Now, this zooms me in well to one corner, but then i still can't drag, and another problem I've found is that the tooltips did not scale with the background; they still show up if you hover over where they would have been. So, how do I properly do this?
The code for zoom-out is the same, only switching back to 100. I do like how the zoom in and out icons stay in the corners no matter what, though, so I need a way to keep the tooltip buttons with the parent BG, but not the zoom icons.
And as for dragging and panning, I've looked everywhere for a simple tutorial, but I haven't found one. I've tried adapting several different source codes to do what I want, but I'm afraid I'm rather out of my depth.
Would somebody mind taking the time to outline step-by-step, in simple terms, how I can achieve what I want?