# Controlling clicked movieclip

**URL:** <https://forum.kirupa.com/t/controlling-clicked-movieclip/287242>\
**Category:** flash\
**Created:** [April 28, 2009, 3:17pm UTC](https://forum.kirupa.com/t/controlling-clicked-movieclip/287242 "2009-04-28T15:17:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lillo\_\_hotmail](https://avatars.discourse-cdn.com/v4/letter/l/ad7895/32.png) [@lillo\_\_hotmail](https://forum.kirupa.com/u/lillo__hotmail)\
**Post date:** [April 28, 2009, 3:17pm UTC](https://forum.kirupa.com/t/controlling-clicked-movieclip/287242/1 "2009-04-28T15:17:49Z")

</div>

Is there a way to capture what movieclip that have been clicked so I don’t have to wright a new “nextFrame” function for every clip

myClip\_mc.addEventListener(MouseEvent.MOUSE\_OVER, overMyClip)  
myClip\_mc.addEventListener(MouseEvent.MOUSE\_OUT, overMyClip)

function overMyClip(event:MouseEvent)  
{  
stage.addEventListener(Event.ENTER\_FRAME, overMyClipPlay)  
stage.removeEventListener(Event.ENTER\_FRAME, overMyClipRew)  
}

function overMyClip(event:MouseEvent)  
{  
stage.addEventListener(Event.ENTER\_FRAME, overMyClipRew)  
stage.removeEventListener(Event.ENTER\_FRAME, overMyClipPlay)  
}

function overMyClipPlay (event:Event)  
{  
myClip\_mc.nextFrame()  
}

function overMyClipRew (event:Event)  
{  
myClip\_mc.prevFrame()  
}

Thanks!
