# Major Issue: MovieClip inside Movieclip will not have MouseEvents?

**URL:** <https://forum.kirupa.com/t/major-issue-movieclip-inside-movieclip-will-not-have-mouseevents/258185>\
**Category:** flash\
**Created:** [April 21, 2008, 7:18pm UTC](https://forum.kirupa.com/t/major-issue-movieclip-inside-movieclip-will-not-have-mouseevents/258185 "2008-04-21T19:18:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DavidOrtiz](https://avatars.discourse-cdn.com/v4/letter/d/e480ec/32.png) [@DavidOrtiz](https://forum.kirupa.com/u/DavidOrtiz)\
**Post date:** [April 21, 2008, 7:18pm UTC](https://forum.kirupa.com/t/major-issue-movieclip-inside-movieclip-will-not-have-mouseevents/258185/1 "2008-04-21T19:18:17Z")

</div>

Hey guys, I got this empty MovieClip i add to the stage called ‘container’. In container, I also dymaically add warrior(), warrior2(), and warrior3(). Now Im trying to add my rollover state for warrior, however, it never works?

When I place the warrors inside of a container in design time and then attach the code and place it on the stage, it works? Any Ideas?

public function addHitState(container:MovieClip, linkage\_name:String, id\_name:String):void{  
var class\_definition:Class = getDefinitionByName(linkage\_name) as Class;  
var added\_clip:DisplayObject = new class\_definition();  
added\_clip.name = id\_name;  
container.addChild(added\_clip);  
added\_clip.x = 1151.2;  
added\_clip.y = 407.8;

```
        added_clip.buttonMode = true;
        added_clip.addEventListener(MouseEvent.ROLL_OVER, rollOverFunction);
    };
    
    private function rollOverFunction(event:MouseEvent):void{
        trace("@");
    };
```
