# Help with MouseWheel

**URL:** <https://forum.kirupa.com/t/help-with-mousewheel/308829>\
**Category:** Uncategorized\
**Created:** [April 30, 2010, 11:49pm UTC](https://forum.kirupa.com/t/help-with-mousewheel/308829 "2010-04-30T23:49:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![darnoldduck](https://avatars.discourse-cdn.com/v4/letter/d/73ab20/32.png) [@darnoldduck](https://forum.kirupa.com/u/darnoldduck)\
**Post date:** [April 30, 2010, 11:49pm UTC](https://forum.kirupa.com/t/help-with-mousewheel/308829/1 "2010-04-30T23:49:44Z")

</div>

Hi.  
The code snippet below is for running thru an index of pics.  
The problem I have is that the following code works perfectly locally but when I run it in a browser the mousewheel advances or declines the picture by 2 instead of 1?!?!  
I sense that it probably has something to do with a browser setting but not sure.  
Any help would be greatly appreciated.

//start code

var indexNumber:int = 0;  
var currentNumPics:int = 10;

stage.addEventListener(MouseEvent.MOUSE\_WHEEL, onMouseWheelEvent);

function onMouseWheelEvent(mw:MouseEvent):void {  
if (mw.delta\<0) {  
if (indexNumber\<=currentNumPics) {  
indexNumber++;  
trace(indexNumber);  
}  
}  
if (mw.delta\>=0) {  
if (indexNumber!=0) {  
indexNumber–;  
trace(indexNumber);  
}  
}  
}  
//end code
