In OpenLaszlo, scrollbars don’t automatically scroll with the mouse wheel. I guess the reason behind this is that scrollbars are very free-form. As a developer, you can make anything scroll, so it would be restrictive if the scrollbars were to respond to mouse wheel events in a predefined way.
To see how to use a scrollbar in OpenLaszlo, see my earlier post on the subject.
It’s really easy to trap mouse wheel events in OpenLaszlo. All you do is listen for the onmouswheeldelta event from the LzKeys service. That’s also the service that sends global keyboard events, by the way. The onmouswheeldelta event sends an argument, which tells you how much the wheel moved, and in what direction (it’s either a positive or a negative number).
To tie this to a scrollbar, you probably want to ensure that the mouse is actually overing above the view you want to scroll. Again, in OpenLaszlo, that’s really easy. There’s a containsPt() method on view, that tells you whether a given point (x,y) is within that view’s coordinate space. And to find the mouse position in a given views coordinate space, you simply call:
LzView.getMouse(“x”) and LzView.getMouse(“y”)
So here’s the application in action. Note that you might need to bring focus from the browser to the SWF by clicking once on the SWF:
Enjoy! (Here's the source to a Mouse Wheel Example).