# Moving a clip onPress with actionscript to current x0, y0 coordinates

**URL:** <https://forum.kirupa.com/t/moving-a-clip-onpress-with-actionscript-to-current-x0-y0-coordinates/217410>\
**Category:** Uncategorized\
**Created:** [February 26, 2007, 7:54pm UTC](https://forum.kirupa.com/t/moving-a-clip-onpress-with-actionscript-to-current-x0-y0-coordinates/217410 "2007-02-26T19:54:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![thegreatwent](https://avatars.discourse-cdn.com/v4/letter/t/ecd19e/32.png) [@thegreatwent](https://forum.kirupa.com/u/thegreatwent)\
**Post date:** [February 26, 2007, 7:54pm UTC](https://forum.kirupa.com/t/moving-a-clip-onpress-with-actionscript-to-current-x0-y0-coordinates/217410/1 "2007-02-26T19:54:55Z")

</div>

I have a site I’m working on in which the movie fills the browser and elements are repositioned according to the available space or if the browser window is resized - [http://www.oroborusmovement.com/flashTest2.html](http://www.oroborusmovement.com/flashTest2.html)

The navigation elements are some spinning circle movie clips that are centered on the stage stored in a container.

What I want to happen is when one of the rings are clicked, the whole navigation moves to the current x 0, and y 0 coordinates so it is repositioned in the top left corner with a quarter of the navigation showing.

I’ve been having a hard time finding info on how to have a clip move when it is clicked itself, and then I’m not sure how to calculate the current x 0, y 0 coordinates to have the nav move there. I can point the nav to the coordinates, but if the window size changes, those values seem to no longer apply and the nav moves to what it thinks are the x 0, y 0 coordinates.

Someone had suggested that I can use localToGlobal, but I’m don’t know how to use the function to animate the navigation -

var point:Object = {x:0,y:0}; //assuming your registration point is in the center of the circles.  
circle\_mc.globalToLocal(point); //circle\_mc being the movie instance that you want to get your globalToLocal x and y.  
circle\_mc.\_x = point.x;  
circle\_mc.\_y = point.y;

I’m trying to avoid using any frame tweening and would prefer to have everything controlled via actionScript.

I have uploaded the source file here - [http://www.oroborusmovement.com/flas...tResizable.fla](http://www.oroborusmovement.com/flas...tResizable.fla)

Any help would be greatly appreciated
