# Zoom like in galaxy

**URL:** <https://forum.kirupa.com/t/zoom-like-in-galaxy/248687>\
**Category:** flash\
**Created:** [January 10, 2008, 6:40pm UTC](https://forum.kirupa.com/t/zoom-like-in-galaxy/248687 "2008-01-10T18:40:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nitech](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/nitech/32/2542_2.png) [@nitech](https://forum.kirupa.com/u/nitech)\
**Post date:** [January 10, 2008, 6:40pm UTC](https://forum.kirupa.com/t/zoom-like-in-galaxy/248687/1 "2008-01-10T18:40:59Z")

</div>

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](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.
