# Working with dynamic clips

**URL:** <https://forum.kirupa.com/t/working-with-dynamic-clips/267583>\
**Category:** Uncategorized\
**Created:** [August 3, 2008, 10:12am UTC](https://forum.kirupa.com/t/working-with-dynamic-clips/267583 "2008-08-03T10:12:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sivant](https://avatars.discourse-cdn.com/v4/letter/s/cc9497/32.png) [@sivant](https://forum.kirupa.com/u/sivant)\
**Post date:** [August 3, 2008, 10:12am UTC](https://forum.kirupa.com/t/working-with-dynamic-clips/267583/1 "2008-08-03T10:12:50Z")

</div>

i created dynamic clips and attaced a movieclip from the library to them:

```auto

for (i=0; i<6; i++) {
 this.createEmptyMovieClip("targetClip"+i, this.getNextHighestDepth());
 _root["targetClip"+i]._x = i*20;
 _root["targetClip"+i].attachMovie("btnM"+i, squere, this.getNextHighestDepth());
}
 

```

i turned them into buttons but it doesnt recognize the dynamic clips;

```auto
for (var m:Number = 0; m<11; m++) {
 this["targetClip"+m] = addBehaviour(m);
}
function addBehaviour(m) {
 this["targetClip"+m].onRelease = function() {
  pressed(this._name);
 };
}
function pressed(storedName) {
 storedName = storedName.slice(10, 12);
 _root["targetClip"+storedName]._y = 400;
}

```

i tried this instead of \_root but it doesnt know what [COLOR=red]\_root[“targetClip”+storedName] [/COLOR]is?
