Zoom like in galaxy

Hi,

I am trying to make a site where a publishing company is going to present it’s portfolio. I want it to work like a universe where the work categories are galaxies and each job (picture is a star.) When a user clicks one galaxy, we’ll zoom to that one (and rotate, if the galaxy has been rotated), and when the user clicks a star (job), we’ll zoom to that one.

I’ve been kicking against the bricks for a while, trying to make this seemingly simple task work. Here, look at this example:

http://www.avento.as/blaest/camera3.html

As you can see, it works quite all right (unless you try to resize the window, so don’t.)

I have created this a version of the vCam I found around the web. It does however prove hard to control, especially when I try to fill out the stage using data from an XML file (and thus I don’t have the same control of sizes and sequence of loading).

Now I wonder; how would you go about in my case? At first I thought I could use localToGlobal to find each movieclip’s position and then zoom and move the universe_mc to the right x, y, _width and _height coordinates – but I just can’t seem to understand the required maths to do that.

Anyone? Kind regards, Nitech.