views:

282

answers:

1

Hi, I'm working on a menu system in flash. If the mousewheel scrolls up each menu item shift up and visa versa for mouse wheel scrolling down.

The problem I have is there seems to be multiple "steps" going on.

In my mouse wheel handler I trace out the text "wheel" to test. If I mouse the mouse wheel just once "wheel" gets traced out twice. So for every one mouse wheel move my handler is being called twice and thus the scrolling of my menu always skips an item.

Any tips?

A: 

What kind of code are you using to detect the mouse wheel events?

mouseListener = new Object();
mouseListener.onMouseWheel = function(delta) {
    // La la la do stuff here
}
Mouse.addListener(mouseListener);

Something like that should be sufficient and not trigger multiple times.

FerretallicA
In my menu class that extends MovieClip I have just added addEventListener(mouseEvent.MouseWheel,myFuntion).It's peculiar alright. I'm developing on a laptop with a mouse plugged in. Maybe that has something to do with it?
dubbeat
Try adding a general listener for Mouse events and add the onMouseWheel qualifier on the listener function as shown above. It's working for me without issue and I work on a laptop with external mouse/keyboard.
FerretallicA
This is not an acceptable answer for this question; for one thing, the code posted is in the wrong language and will not work in ActionScript 3.
Cory Petosky