# How to trace coordinates of attached movieClip?

**URL:** <https://forum.kirupa.com/t/how-to-trace-coordinates-of-attached-movieclip/284730>\
**Category:** flash\
**Created:** [March 23, 2009, 3:59am UTC](https://forum.kirupa.com/t/how-to-trace-coordinates-of-attached-movieclip/284730 "2009-03-23T03:59:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![descalabro](https://avatars.discourse-cdn.com/v4/letter/d/c6cbf5/32.png) [@descalabro](https://forum.kirupa.com/u/descalabro)\
**Post date:** [March 23, 2009, 3:59am UTC](https://forum.kirupa.com/t/how-to-trace-coordinates-of-attached-movieclip/284730/1 "2009-03-23T03:59:47Z")

</div>

**[CS3/AS2]**

Hi.

If I attach a movieClip this way:

```auto

_root.attachMovie("object"+i,"object"+i,i,{_x:_root.objectx*, _y:_root.objecty*});

```

How do I trace its x and y coordinates?

I tried (and many other ways):

```auto

trace(_root["object"+i]._x);

```

It doesn’t show any error but the result is undefined.

The important part of the whole code is this:

```auto

for (i=0; i<_root.objects.length; i++) {
    if (_root.objects* == 0) {
        if (_root.objectsframe* == _root._currentframe) {
           _root.objects* = 1;
           _root.attachMovie("object"+i,"object"+i,i,{_x:_root.objectx*, _y:_root.objecty*});
           trace("puts object "+i);
           trace("at frame "+_root._currentframe);
        }
    }
}

```

Thanks for any help.
