# Movie clip coordinates

**URL:** <https://forum.kirupa.com/t/movie-clip-coordinates/207474>\
**Category:** flash\
**Created:** [November 17, 2006, 10:18pm UTC](https://forum.kirupa.com/t/movie-clip-coordinates/207474 "2006-11-17T22:18:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![seaRocks](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@seaRocks](https://forum.kirupa.com/u/seaRocks)\
**Post date:** [November 17, 2006, 10:18pm UTC](https://forum.kirupa.com/t/movie-clip-coordinates/207474/1 "2006-11-17T22:18:35Z")

</div>

I am trying to get a movie clip - nested inside another movie clip on the stage - to match the x, y coordinates of the mouse. Attached is an example file both in Flash 8 and MX2004 formats.

I can get the drag to occur, but the problem is that the dragged mc’s coordinates are relative to it’s parent movie clip and not the stage. I have been messing around with localToGlobal with not much luck. I think I may be using it wrong, though. I have left it out of the example file. Here is the relevant code:

```auto

var dragging = false;
this.onMouseMove = function() {
	if (dragging == true) {
		this.container.drag._x = _xmouse;
		this.container.drag._y = _ymouse;
	}
};
this.container.drag.onPress = function() {
	dragging = true;
};
this.container.drag.onRelease = function() {
	dragging = false;
};
this.container.drag.onReleaseOutside = function() {
	dragging = false;
};

```

Thanks so much for any help.
