Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flex Spark List Mouse Wheel Scroll Speed

I have a component extending a Spark List, and when I scroll using the mouse wheel it scrolls too much in one go. I have tried looking for the handler that deals with mouse wheel scrolling in the List class and VerticalLayout class to override but I cannot find it.

Is there another way I'm supposed to change this, or am I missing something?

like image 974
Heather Roberts Avatar asked Mar 07 '11 13:03

Heather Roberts


1 Answers

The "delta" property of MouseEvent.MOUSE_WHEEL defines how many lines will be scrolled by one wheel-scrolling. You could try changing it in the MOUSE_WHEEL handler (during capture phase). For example the following code will scroll line-by-line:

        protected function init(event:FlexEvent):void
        {
            list.addEventListener(MouseEvent.MOUSE_WHEEL, list_mouseWheelHandler, true);
        }

        protected function list_mouseWheelHandler(event:MouseEvent):void
        {
            event.delta = event.delta > 0 ? 1 : -1;
        }

like image 70
Maria Sakharova Avatar answered Sep 20 '22 03:09

Maria Sakharova