# onMouseWheel problem

**URL:** <https://forum.kirupa.com/t/onmousewheel-problem/178345>\
**Category:** flash\
**Created:** [February 9, 2006, 5:05pm UTC](https://forum.kirupa.com/t/onmousewheel-problem/178345 "2006-02-09T17:05:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Morix](https://avatars.discourse-cdn.com/v4/letter/m/dfb087/32.png) [@Morix](https://forum.kirupa.com/u/Morix)\
**Post date:** [February 9, 2006, 5:05pm UTC](https://forum.kirupa.com/t/onmousewheel-problem/178345/1 "2006-02-09T17:05:48Z")

</div>

Hi,

I have a simple function that traces the delta value of the onMouseWHeel function.

When I hit ctrl-enter all things work fine and I get the fowlling result:

trace: 3

But when I hit ctrl-enter again (downloade sim mode) I get twice the values, its like the function get called twice:

trace: 3  
trace: 3

The problem now is that I use the onmouswWheel function to scroll some products (like [www.thefwa.com](http://www.thefwa.com)) but when ever I reload the swf (going to another section and back) the scrolling function get messed up because I get double values instead of a single value.

Quick AS to test for your own:  
[AS]  
var mouseListener:Object = new Object();  
mouseListener.onMouseWheel = function(delta:Number) {  
trace("trace: "+delta);  
};  
Mouse.addListener(mouseListener);  
[/AS]
