# Dynamic event handler problem?

**URL:** <https://forum.kirupa.com/t/dynamic-event-handler-problem/209330>\
**Category:** Uncategorized\
**Created:** [December 7, 2006, 7:24pm UTC](https://forum.kirupa.com/t/dynamic-event-handler-problem/209330 "2006-12-07T19:24:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fatPluto](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/fatpluto/32/2874_2.png) [@fatPluto](https://forum.kirupa.com/u/fatPluto)\
**Post date:** [December 7, 2006, 7:24pm UTC](https://forum.kirupa.com/t/dynamic-event-handler-problem/209330/1 "2006-12-07T19:24:41Z")

</div>

HEllo-

I am creating a photo gallery… I load all the thumbnail images dynamically into an empty movieClip which is attached to a movie clip called “thumbs” from the library. all is working, except the onRelease method for each thumbnail mc is not triggering. here is the code- thanks for your wisdom!

//loadThumbs();  
for (i = 1; i \< 17; i++) {  
var t = “thumb” + i;  
thumbs.attachMovie(“image”, t, i);  
thumbs[t].\_x = 85\*(i-1);  
thumbs[t].loadMovie(this.pathToThumbs + this.tArray\*, i);  
thumbs[t].onRelease = function() {  
thumbnail(this);  
trace(this);  
};  
}
