# Help!: Nested movieclips, event listeners and depth

**URL:** <https://forum.kirupa.com/t/help-nested-movieclips-event-listeners-and-depth/171192>\
**Category:** flash\
**Created:** [December 2, 2005, 5:11pm UTC](https://forum.kirupa.com/t/help-nested-movieclips-event-listeners-and-depth/171192 "2005-12-02T17:11:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbkons](https://avatars.discourse-cdn.com/v4/letter/j/ecc23a/32.png) [@jbkons](https://forum.kirupa.com/u/jbkons)\
**Post date:** [December 2, 2005, 5:11pm UTC](https://forum.kirupa.com/t/help-nested-movieclips-event-listeners-and-depth/171192/1 "2005-12-02T17:11:42Z")

</div>

Hi Guys,

I have two movie clips. The child movieclip is a button with rollover events which is nested inside the parent. I would like the parent to also have rollover events, but I understand that this is not possible in flash. I am familiar with two workarounds: event bubbling/delegation and the event listeners.

I was wondering if you guys could suggest the most easy way for both the parent and the child to have rollover events.

Currently, the child clip is a button that animates on rollover. The parent clip holds several of the child clip buttons. The parent will be on the stage with other movie clips, and on rollover I would like the parent to have a swapdepths function to reach the maximum depth to be on top of all the other movie clips on the stage.

I have tried both methods to no avail, and I was wondering if you guys could give me an example of the most simple method to accomplish this. Because I am very new to actionscript, if you could post an example of the required code that would be most helpful. Thanks guys!
