# \[FlashCS3/AS2\] How do I put a rollover on a dynamically created movieclip?

**URL:** <https://forum.kirupa.com/t/flashcs3-as2-how-do-i-put-a-rollover-on-a-dynamically-created-movieclip/287916>\
**Category:** flash\
**Created:** [May 7, 2009, 7:45pm UTC](https://forum.kirupa.com/t/flashcs3-as2-how-do-i-put-a-rollover-on-a-dynamically-created-movieclip/287916 "2009-05-07T19:45:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![eclosion](https://avatars.discourse-cdn.com/v4/letter/e/dc4da7/32.png) [@eclosion](https://forum.kirupa.com/u/eclosion)\
**Post date:** [May 7, 2009, 7:45pm UTC](https://forum.kirupa.com/t/flashcs3-as2-how-do-i-put-a-rollover-on-a-dynamically-created-movieclip/287916/1 "2009-05-07T19:45:09Z")

</div>

Hi all,

How do I put a rollover on a dynamically created movieclip?

I have several movieclips being placed inside a container movieclip and I need them to have onRollOver, onRollOut and onRelease events. The way I usually target and do this…

\_root._mcContainerName_._mcName_.onRollOver = function() {  
\_root._mcContainerName_\*.mcName.\*gotoAndStop(“over”);  
}

…does not seem to work for whatever reason. However, if I put a named instance of the movieclip on the stage myself and target it in exactly the same way (with similar syntax), the rollover works fine.

Can anyone tell me how I can get around this? Thanks in advance.
