Flex Spark List鼠标滚轮滚动速度 [英] Flex Spark List Mouse Wheel Scroll Speed

查看:174
本文介绍了Flex Spark List鼠标滚轮滚动速度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个扩展了Spark List的组件,当我使用鼠标滚轮滚动时,它滚动得太多了。我已经尝试寻找在List类和VerticalLayout类中滚动鼠标滚轮的处理程序来覆盖,但我无法找到它。



有没有另一种方法我应该改变这个,或者我错过了什么?

解决方案

MouseEvent.MOUSE_WHEEL的delta属性定义了多少行滚动一个滚轮。您可以尝试在MOUSE_WHEEL处理程序中更改它(在捕获阶段)。例如,以下代码将逐行滚动:



<$ p $保存函数init(event:FlexEvent):void
{
list.addEventListener(MouseEvent.MOUSE_WHEEL,list_mouseWheelHandler,true);


保护函数list_mouseWheelHandler(event:MouseEvent):void
{
event.delta = event.delta> 0? 1:-1;

$ / code>


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?

解决方案

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;
        }

这篇关于Flex Spark List鼠标滚轮滚动速度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆