# MC's overwriting themselves

**URL:** <https://forum.kirupa.com/t/mcs-overwriting-themselves/230535>\
**Category:** flash\
**Created:** [June 27, 2007, 1:05am UTC](https://forum.kirupa.com/t/mcs-overwriting-themselves/230535 "2007-06-27T01:05:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bpdp](https://avatars.discourse-cdn.com/v4/letter/b/c0e974/32.png) [@bpdp](https://forum.kirupa.com/u/bpdp)\
**Post date:** [June 27, 2007, 1:05am UTC](https://forum.kirupa.com/t/mcs-overwriting-themselves/230535/1 "2007-06-27T01:05:30Z")

</div>

This is should be an easy one, but i can’t figure it out. I have a for loop that attaches a new mc to the stage fills it with info from a database. I should be left with three mc’s but not the case. only the last one shows up on the stage. I went thru it with the debugger and it is filling all those movieClips with data but, overwrites them when it goes back to the top of the for loop.

```auto

for (var i:Number = 0; i<myLoadVars.numRows; i++) {
	attachMovie("entry", "entry" + i, this.getNextHighestDepth());
	_root["entry" + i].id_txt.text = this['id' + i];
	_root["entry" + i].firstName_txt.text = this["firstName" + i];
	_root["entry" + i].lastName_txt.text = this["lastName" + i];
	_root["entry" + i].year_txt.text = this["year" + i];
	_root["entry" + i].entries_txt.text = this["statement" + i];
	loadMovie(this["picUrl" + i], _root["entry" + i].empty);
	_root["entry" +i]._y = i * 10;
	_root["entry" +i]._x = xPos;
	trace(_root["entry" +i]._y)
	}

```

I’ve also tried something like:

```auto
myClip = attachMovie("entry", "entry" + i, this.getNextHighestDepth());

```

and a few other things that i can’t think of right now. any ideas?
