# Dynamically generated clips won't react to mouseevents

**URL:** <https://forum.kirupa.com/t/dynamically-generated-clips-wont-react-to-mouseevents/19614>\
**Category:** Uncategorized\
**Created:** [April 29, 2003, 9:23pm UTC](https://forum.kirupa.com/t/dynamically-generated-clips-wont-react-to-mouseevents/19614 "2003-04-29T21:23:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stanley](https://avatars.discourse-cdn.com/v4/letter/s/7ab992/32.png) [@Stanley](https://forum.kirupa.com/u/Stanley)\
**Post date:** [April 29, 2003, 9:23pm UTC](https://forum.kirupa.com/t/dynamically-generated-clips-wont-react-to-mouseevents/19614/1 "2003-04-29T21:23:10Z")

</div>

When dynamically generating movieclips, how can you add a

myMovieClip.onRelease = function () {  
what needs to be done comes here …  
};

Here’s my code

for(i=1;i\<=\_root.artcounter;i++){  
content.duplicateMovieClip(“content”+i,i\*1000);  
this[“content”+i].id = i;  
if(i == 1){  
this[“content”+i].\_y = 22;  
this[“content”+i].\_x = 0;  
}  
this[“content”+i].loadMovie(i+".jpg");  
this[“content”+i].\_height = 10;  
this[“content”+i].\_y = this[“content”+(i-1)].\_y+this[“content”+(i-1)].\_height;

}

It generates movieclips by duplicating a clip, loads a jpg into every generated clip and then places them in an \_y position. But now I need to press them like they are buttons, and that won’t work…

Anyone ?

thanks

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 29, 2003, 10:02pm UTC](https://forum.kirupa.com/t/dynamically-generated-clips-wont-react-to-mouseevents/19614/2 "2003-04-29T22:02:25Z")

</div>

a search usually helps… 😉

[http://www.kirupaforum.com/forums/showthread.php?s=&threadid=21709](http://www.kirupaforum.com/forums/showthread.php?s=&threadid=21709)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 30, 2003, 7:27am UTC](https://forum.kirupa.com/t/dynamically-generated-clips-wont-react-to-mouseevents/19614/3 "2003-04-30T07:27:37Z")

</div>

Oops…  
You’re right. Found my answer there …

“The problem was you can’t assign actions to a MC, that is a JPG”

thanks anyway.  
:pope:
