Frustrated with Mouse and Centering - Advise Please

Hi group. I’m new here and I’m hope to get some input or suggestions on a project I’ve become very frustrated with! I’m trying to get a movie clip to center around mouse coordinates. But different that what I’ve read in other forums. Most of the solutions mention center around a mouse click . . . I want to detect a mouse click an coordinates on one Movie Clip and translate those to another taking into account the second Movie Clip’s scaling. Please Help!

Here’s a link to my SWF: http://www.bigplan.net/sdbp/SECWebsiteMaster-05312005-101-TESTing02.swf

In the document I have two maps. The first map on the left is a movie clip created by the createEmptyMovieClip and is set to load at 100%. All the map objects in this map are loaded from the library with attachMovie. The registration point of all the map objects is centered and I call it FullMap. The second map to the right is loaded the same way, via loading an empty movie clip with the same map objects from the library as the FullMap on the left and is called ZoomMap. The main difference between them is that the ZoomMap is scaled up 300% and is loaded behind a Mask.

At the top I’ve created a nice zoom bar which is really several movie clips with set the ZoomMap percent higher or lower. Bascially starting at 150% up to 450%. My code for this is like this:

ActionScript:

 

onRollOver = function () {
	 this.gotoAndPlay("Over");
};

onRollOut = function () {
	 this.gotoAndPlay("Up");
};

onPress = function () {
	 _root.zoomMap._xscale = 450;
	 _root.zoomMap._yscale = 450;
};


Now the trouble . . . I need to be able to click on the point in the FullMap and have the ZoomMap center itself around the same point on the right side. For the life of me I can’t seem to grasp the concept of the mouse coordinates from the FullMap and translate them accurately to the ZoomMap. I know I’ve posted before, but if someone can help me with more detailed info I would sure appreciate it!

Here’s some information about what I’m doing with the mouse so far. I’m capturing the mouse coordinates on my FullMap using this code:

ActionScript:

 

//LISTENER TO DETECT COORDINATES OF MOUSE ON FULLMAP
myMouse = new Object(); 
myMouse.onMouseMove = function () {
	 xPos = _root._xmouse;
	 yPos = _root._ymouse;
};

Mouse.addListener(myMouse);


//FUNCTION TO RECENTER ZOOMMAP UPON MOUSE CLICK IN FULLMAP
myMouse.onMouseDown = function () {
	 setProperty( _root.zoomMap,_x,xPos+580);
	 setProperty( _root.zoomMap,_y,yPos);
};


The problem as you’ll see when you click on the FullMap is it doesn’t translate correctly at all! I’ve messed with the xPos and yPos output, but haven’t found the logic behind the recentering I have.

Another problem is that the mouse listener will report the coordinates even outside the FullMap, which is a problem on my Route Navigation to the left.

How would I only grab the coordinates of the mouse on FullMap?

Also, I believe that my zooming bar will affect the coordinates. The coordinates to translate to will be different zoomed in at 150% than at 400% . . . is this correct?

If so, how would I compensate my mouse listener or output to take that into account?

I would be happy to post anything needed for a solution as well as my final code for anyone else looking for something like this in the future.

Thanks a bunch,
RedWombat