# Activate function while mouse is over movieclip?

**URL:** <https://forum.kirupa.com/t/activate-function-while-mouse-is-over-movieclip/310075>\
**Category:** flash\
**Created:** [June 1, 2010, 12:00am UTC](https://forum.kirupa.com/t/activate-function-while-mouse-is-over-movieclip/310075 "2010-06-01T00:00:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nimaro](https://avatars.discourse-cdn.com/v4/letter/n/7bcc69/32.png) [@Nimaro](https://forum.kirupa.com/u/Nimaro)\
**Post date:** [June 1, 2010, 12:00am UTC](https://forum.kirupa.com/t/activate-function-while-mouse-is-over-movieclip/310075/1 "2010-06-01T00:00:00Z")

</div>

hy everyone,

Im trying to make a image gallery, that then the i get to the left side of the movieclip is moves to the left and when im in the right it does that way 🙂

I already made this using tweens…  
But i want that while im over the left side of the movieclip it keeps doing tweens to the left… same for the otherside ofc 🙂

Im not finding a way to keep it always doing the tweens… i have to move mouse so it animates.

i got something like this:

```auto

import fl.transitions.Tween;
import fl.transitions.easing.*;

//1.
scroller.addEventListener(MouseEvent.MOUSE_OVER, mover);

function mover(event:MouseEvent) {
        if (mouseX < 0)
        {
            var myTween:Tween = new Tween(scroller, "x", Regular.easeOut, scroller.x, scroller.x + 50, 1, true);
        }
        else if (mouseX > 0)
        {
            var myTween2:Tween = new Tween(scroller, "x", Strong.easeOut, scroller.x, scroller.x - 50, 1, true);
        }
        txt.text= "X Stage: " + String(scroller.x);
}

```

Hope u guys can help me finding a way to complete what im trying to do.
