# Problem with dynamically added movie clip handlers

**URL:** <https://forum.kirupa.com/t/problem-with-dynamically-added-movie-clip-handlers/218398>\
**Category:** Uncategorized\
**Created:** [March 7, 2007, 2:24pm UTC](https://forum.kirupa.com/t/problem-with-dynamically-added-movie-clip-handlers/218398 "2007-03-07T14:24:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mtt\_losd2](https://avatars.discourse-cdn.com/v4/letter/m/94ad74/32.png) [@mtt\_losd2](https://forum.kirupa.com/u/mtt_losd2)\
**Post date:** [March 7, 2007, 2:24pm UTC](https://forum.kirupa.com/t/problem-with-dynamically-added-movie-clip-handlers/218398/1 "2007-03-07T14:24:31Z")

</div>

I am generating movie clips and loading movie clips into them dynamically with the movieClipLoader class when jpegs are loading into each movie (onLoadComplete) I assign a handler to them:

myListener.onLoadComplete = function(targetMC){ //set the onComplete function on listener  
targetMC.onPress = function() { //define onPress within function  
trace(newline + "targetMC = " + targetMC.\_name);  
}  
}

for some reason when i paste this code into a clean one frame flash file with nothing else in it the handlers work.

But in my movie the dynamic movieClips get loading into another movieClip which has a onMouseOver handler as well might this be the reason why the dynamically generated handlers are not working?
