# Scroll problem as 3.0

**URL:** <https://forum.kirupa.com/t/scroll-problem-as-3-0/327028>\
**Category:** flash\
**Created:** [January 31, 2012, 7:29pm UTC](https://forum.kirupa.com/t/scroll-problem-as-3-0/327028 "2012-01-31T19:29:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Enza89](https://avatars.discourse-cdn.com/v4/letter/e/e95f7d/32.png) [@Enza89](https://forum.kirupa.com/u/Enza89)\
**Post date:** [January 31, 2012, 7:29pm UTC](https://forum.kirupa.com/t/scroll-problem-as-3-0/327028/1 "2012-01-31T19:29:32Z")

</div>

Hello,

I am making an application in which I build a timeline that scrolls when the user moves over a button.

That is working, but is goes just one time forward and it had to scroll until the user removes the mouse from the button.

The code I am using is the following:

```auto

stop();

var limit:Number = stage.stageWidth - mc_opdrachten.width;  
var speed:Number = 0.1;
var scrollX:Number = 1;

mc_left.addEventListener(MouseEvent.ROLL_OVER, scrollOpdrachtenLeft);

function scrollOpdrachtenLeft(e:Event):void {
	scrollX = - speed * mc_left.mouseX; 
	mc_opdrachten.x+= scrollX; 
	if (mc_opdrachten.x>0.8) { mc_opdrachten.x= 0.8;}
	else if (mc_opdrachten.x< limit) { mc_opdrachten.x= limit; }
}

```

I hope someone is willing to help me 😃

Greets Enza
