I'm trying to create a graphing application in flash and have run into a brick wall with the zooming maths. I need to be able to zoom in on a specific point (the centre of the screen), but that focus point can change as you pan across the graph. One rule is that the area showing when the graph is initialized (at scale = 1) is the max area you can see. in other words you can't pan till you zoom. I've got the zooming mostly working and same with the panning, except when you zoom, and then move the focus point and try to zoom more or zoom out, it stuffs it up completely.

btw i don't want to increase the size of the data points on the graph on a zoom, so to give the impression of a zoom, I am moving the dots. I have this part working fine.

I know this is confusing but if you can understand what I am saying please help.

i'm basically trying to recreate this...
http://www.nytimes.com/packages/html...HIC/index.html

except that the zoom is done by a slider rather than dragging the x or y axis.
I've got most of it working just the part where you pan and zoom more. when you do this it moves the dots to where they would have been if the new focus point had been the original focus point, so the dots jump but then zoom from the new focus point correctly