# Dynamic movieclip names

**URL:** <https://forum.kirupa.com/t/dynamic-movieclip-names/157372>\
**Category:** Uncategorized\
**Created:** [August 1, 2005, 3:47pm UTC](https://forum.kirupa.com/t/dynamic-movieclip-names/157372 "2005-08-01T15:47:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ArcanE](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/arcane/32/183_2.png) [@ArcanE](https://forum.kirupa.com/u/ArcanE)\
**Post date:** [August 1, 2005, 3:47pm UTC](https://forum.kirupa.com/t/dynamic-movieclip-names/157372/1 "2005-08-01T15:47:46Z")

</div>

Anyone can help me with this one?  
I’ve got this code but apparently the reference to the button doesn’t work since i get an AS error upon execution.

```php
for (i=0; i<5; i++) {
	var xPos:Number = (i * movieWidth) + 30;
	newMC = _root.myContainer.attachMovie("fiche","fiche"+i,i, {_x:xPos, _y:15});
	_root.topMenu.["button"+i].onPress = function() {
		_root.myContainer.easeX((-640*i));
	}
}

```

I’ve already tried without the brackets but that yields the same result.

Any help is appreciated.

Chris
