# Coordinates... coordinates

**URL:** <https://forum.kirupa.com/t/coordinates-coordinates/205163>\
**Category:** Uncategorized\
**Created:** [October 26, 2006, 7:11pm UTC](https://forum.kirupa.com/t/coordinates-coordinates/205163 "2006-10-26T19:11:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![masster](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/masster/32/627_2.png) [@masster](https://forum.kirupa.com/u/masster)\
**Post date:** [October 26, 2006, 7:11pm UTC](https://forum.kirupa.com/t/coordinates-coordinates/205163/1 "2006-10-26T19:11:54Z")

</div>

Hi,

I have this little movie (see [http://www.masster.ro/test/but.swf](http://www.masster.ro/test/but.swf))  
Source files are at [http://www.masster.ro/test/but.rar](http://www.masster.ro/test/but.rar)

The smiley is loaded from an external SWF and it should work like this: if I drag the smiley over the red circle, smiley gets circle’s coordinates. Right now it jumps to the right and lower.

I know why: coordinates are relative to parent movie and red circle is in \_root timeline while smiley is external (thus having its own coordinate system). But I can’t get the right syntax to correct it. Can you help me correct my code, please?

Smiley is a movie having this code attached:

> on (press) {  
> startDrag(this, true);  
> origX = this.\_x;  
> origY = this.\_y;  
> }  
> on (release, releaseOutside) {  
> stopDrag();  
> if (this.\_droptarget == “/hole”) {  
> \_root.place(this);  
> } else {  
> this.\_x = origX;  
> this.\_y = origY;  
> }  
> }

Main movie action is like this:

> var xPos = 120;  
> var yPos = 20;  
> this.attachMovie(“container”, “sm”, this.getNextHighestDepth(), {\_x:xPos, \_y:yPos});  
> loadMovie(‘smile.swf’, sm);  
> function place(a) {  
> sm.\_x = hole.\_x;  
> sm.\_y = hole.\_y;  
> }

Thanks
