# On MouseOver keep moving movieclip x

**URL:** <https://forum.kirupa.com/t/on-mouseover-keep-moving-movieclip-x/284570>\
**Category:** flash\
**Created:** [March 20, 2009, 11:24am UTC](https://forum.kirupa.com/t/on-mouseover-keep-moving-movieclip-x/284570 "2009-03-20T11:24:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rdinicut](https://avatars.discourse-cdn.com/v4/letter/r/7cd45c/32.png) [@Rdinicut](https://forum.kirupa.com/u/Rdinicut)\
**Post date:** [March 20, 2009, 11:24am UTC](https://forum.kirupa.com/t/on-mouseover-keep-moving-movieclip-x/284570/1 "2009-03-20T11:24:06Z")

</div>

![](http://demo.prologue.ro/hdmall/example.jpg)

I hope u can understand what i’m trying to do from my stupid drawing…  
Anyways…so far i got it working but i have the feeling it’s not the best practice and my swf file moves like crap in all browser except Firefox.So if one of you guys could give a hand it will be great.

**CODE:**  
function Move\_left(e:MouseEvent) {  
myTimer = new Timer(0.1, 1000);  
myTimer.addEventListener(“timer”, timerHandlerleft);  
myTimer.start();  
}

function timerHandlerleft(event:TimerEvent):void {  
if((box\_mc.x+box\_mc.width+10)\<=next\_btn.x)  
{  
Stopit(null);  
}  
else  
{  
lowerbox.x-=0.3;  
pre\_btn.addEventListener(MouseEvent.MOUSE\_OUT, Stopit);  
}  
}  
function Move\_right(e:MouseEvent) {  
myTimer = new Timer(0.1, 1000);  
myTimer.addEventListener(“timer”, timerHandlerright);  
myTimer.start();  
}

function timerHandlerright(event:TimerEvent):void {

```
        if(box_mc.x&lt;=pre_btn.x+20)
        {
            lowerbox.x+=0.3;
            next_btn.addEventListener(MouseEvent.MOUSE_OUT, Stopit);
        }
        else
        {
        Stopit(null);
        }
    }

```

function Stopit(e:MouseEvent):void{  
myTimer.stop();

```
    }
```
