# Help with dynamically created MC's

**URL:** <https://forum.kirupa.com/t/help-with-dynamically-created-mcs/159305>\
**Category:** Uncategorized\
**Created:** [August 16, 2005, 5:08pm UTC](https://forum.kirupa.com/t/help-with-dynamically-created-mcs/159305 "2005-08-16T17:08:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tomaz](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/tomaz/32/1366_2.png) [@Tomaz](https://forum.kirupa.com/u/Tomaz)\
**Post date:** [August 16, 2005, 5:08pm UTC](https://forum.kirupa.com/t/help-with-dynamically-created-mcs/159305/1 "2005-08-16T17:08:05Z")

</div>

Im having a problem referencing AS created movie clips. I have a for loop that creates movie clips, names them, but when i want to give them all the same onRelease event, it doesn’t work. Nor does the move command (\_y value) work… The following code would make me 5 boxes, which would take viewer to the same page if clicked…

```auto

		for (var i = 0; i<xnRoot.childNodes.length; i++) {
			xnIzbira = xnRoot.childNodes*;
		    // trace(xnIzbira.firstChild.nodeValue);
			//give it a variable name slikca so i can refer to each of them but it doesn't work
			this.createEmptyMovieClip(slikca="navBG"+i, 50-i);
			with (slikca) {
				beginFill(0xF0F0F0, 100);
				lineStyle(1, 0x3B81BF, 80);
				moveTo(0, 0);
				lineTo(117, 0);
				lineTo(117, 17);
				lineTo(0, 17);
				lineTo(0, 0);
				endFill;
			}
			slikca._y = 1*17;
			this.slikca.onRelease = function() {
				trace("RollOut");
			};
}

```
