【发布时间】:2011-09-01 07:16:59
【问题描述】:
我在使用鼠标滚轮滚动 VBox 时遇到问题。当鼠标悬停在 VBox 中的任何组件或垂直滚动条上时,它可以正常工作,但当鼠标悬停在 VBox 的背景上时,不会发生滚动。
<mx:VBox width="100%" height="150">
<s:Label text="A large label." height="100" />
<s:Label text="A label." />
<s:Label text="A label." />
<s:Label text="A label." />
<s:Label text="A label." />
<s:Label text="A large label." height="100" />
<s:Label text="A label." />
<s:Label text="A label." />
<s:Label text="A label." />
<s:Label text="A label." />
</mx:VBox>
我查看了 VBox 和 Container(VBox 继承)的代码。当存在垂直滚动条时,Container 会为其自身添加一个 MouseEvent.MOUSE_WHEEL 侦听器。我在这个函数中设置了一个断点,但只有当我的鼠标悬停在子组件上时才会调用它。
作为最后的努力,我尝试设置 mouseEnabled、focusEnabled 和其他一些随机属性,但这些都没有帮助。
有没有人知道如何让 VBox 正确运行并在我的鼠标悬停在 VBox 上方时滚动?提前致谢。
(由于不需要的捕捉行为,目前不能切换到 spark Scroller。)
【问题讨论】:
标签: apache-flex flex3