# Strange thing occurring with my rollover scrolling menu

**URL:** https://forum.kirupa.com/t/strange-thing-occurring-with-my-rollover-scrolling-menu/279630
**Category:** Uncategorized
**Created:** [January 16, 2009, 6:24pm UTC](https://forum.kirupa.com/t/strange-thing-occurring-with-my-rollover-scrolling-menu/279630 "2009-01-16T18:24:08Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![tugboat](https://avatars.discourse-cdn.com/v4/letter/t/df705f/32.png) [@tugboat](https://forum.kirupa.com/u/tugboat)
#### Post date: [January 16, 2009, 6:24pm UTC](https://forum.kirupa.com/t/strange-thing-occurring-with-my-rollover-scrolling-menu/279630/1 "2009-01-16T18:24:08Z")

</div>

I really don’t know why this is happening.

I have a menu on the side of the screen (“sidePanel\_mc”) that should scroll inversely when the cursor is placed over it (meaning that when the cursor moves down, the menu goes up and vice versa).

The inexplicable occurrence is this: the pace at which the side menu moves is progressively accelerating, even though I have it fixed at “1”. So each time you move the mouse, let’s say, a centimeter, the menu will shift progressively more pixels until it covers its entire allowed movement.

I don’t know what I’m missing, although I fear it is something obvious. Any help would be appreciated.

Here’s the code:

[SIZE=“2”]  
var startY:Number = new Number;  
var mouseStartY:Number = new Number;  
var difference:Number = new Number;

sidePanel\_mc.addEventListener(MouseEvent.MOUSE\_OVER, startScroll);

function startScroll(e:MouseEvent)  
{  
mouseStartY = mouseY;  
startY = sidePanel\_mc.y;

```
sidePanel_mc.addEventListener(MouseEvent.MOUSE_MOVE, scrollY);

function scrollY(e:Event)
{
	
	difference = mouseY-mouseStartY;
	
	if(difference &lt; 0)
	{
		if(sidePanel_mc.y &lt;66){sidePanel_mc.y += 1;};
		
	};
	if(difference &gt; 0)
	{
		if(sidePanel_mc.y &gt;-378){sidePanel_mc.y -= 1;};
		
	};
	
	
}

```

};  
[/SIZE]
