# Help with attachMovie()

**URL:** <https://forum.kirupa.com/t/help-with-attachmovie/167969>\
**Category:** Uncategorized\
**Created:** [November 2, 2005, 8:36pm UTC](https://forum.kirupa.com/t/help-with-attachmovie/167969 "2005-11-02T20:36:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![maciejwantusiak](https://avatars.discourse-cdn.com/v4/letter/m/b9e5f3/32.png) [@maciejwantusiak](https://forum.kirupa.com/u/maciejwantusiak)\
**Post date:** [November 2, 2005, 8:36pm UTC](https://forum.kirupa.com/t/help-with-attachmovie/167969/1 "2005-11-02T20:36:54Z")

</div>

Can some one tell me why the following code won’t display the new instance’s position and instead report “undefined”?

```auto
row = column = 0;
for (i=0; i<30; i++) {
[indent]for (j=0; j<20; j++) {[indent]newNoc = "noc_" + row + "_" + column;

positionX = j*(66.3+10);
positionY = i*(41.1+5);
depth = this.getNextHighestDepth();
this.attachMovie("noc", newNoc, depth, {_x:positionX, _y:positionY});
 
// this one reports that the instance is there
trace(this.getInstanceAtDepth(depth)); 
 
//this one gives undefined
trace(this.newNoc._x); 
column++;

[/indent]}

row++;
column=0;

[/indent]}

stop();

```
