# Problem with onRelease set on dynamicly created mcs

**URL:** <https://forum.kirupa.com/t/problem-with-onrelease-set-on-dynamicly-created-mcs/126643>\
**Category:** Uncategorized\
**Created:** [October 26, 2004, 3:39am UTC](https://forum.kirupa.com/t/problem-with-onrelease-set-on-dynamicly-created-mcs/126643 "2004-10-26T03:39:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![posidan](https://avatars.discourse-cdn.com/v4/letter/p/7cd45c/32.png) [@posidan](https://forum.kirupa.com/u/posidan)\
**Post date:** [October 26, 2004, 3:39am UTC](https://forum.kirupa.com/t/problem-with-onrelease-set-on-dynamicly-created-mcs/126643/1 "2004-10-26T03:39:13Z")

</div>

Hi!  
Ok, im trying to do a photogallery here, dynamically loaded from a XML. The XML part is perfectly working, i can create my movieclips with no problem either, and place them where i want them. the thing now is that even if i try to add a onRelease event on each mc i dynamically create, it doesnt seem to work. Im sure its something really easy that i just dont understand, but im stuck here and the project is due in a week (with still many things to complete…)

So any help would be more than appreciated.

Heres the loop where i create my mcs and attach them to my thumbnail container mc:

```php
for (i=0; i<_root.pix_number; i++) {
  // if theres more than 10 pictures, we add another film overlay
  if (count > 20) {			 
    _root.film.thumbs.attachMovie("film_overlay","overlay"+i,i);
    new_film = _root.film.thumbs["overlay"+i];
    new_film._x = -1847;
    count = 1;
  }
				
  var mc = film.thumbs.pix_container.createEmptyMovieClip("mc" + i, i);
  // Position the new mc
  mc._x = 705 - (i*70 + (6.8*(i+1)));
  mc._y = 15;

  // Adds a event listener to the thumbnail so that when its clicked
  // it loads a picture in the photobucket
  mc.onRelease = function () {
    trace("mc clicked");
    // load photo in photobucket
  }
				
  var url = "images/" + pixArray*.thumbnail;
  myLoader.load(mc, url);
  count++;
}

```

myLoader is a qlod.loaderClass object here. I just cant click on the pictures to make them load a bigger one in the frame i have.

Any help would be greatly appreciated…THANKS
