in Technology

Scrolling with mouse wheel in Flex application – even on Mac

By default Flex components do not scroll as you scroll using the wheel on your mouse. You can achieve this by writing a mouseWheel event handler, checked the delta value and scrolling up or down depending on whether it’s positive or negative.

But that does not work on Mac OS X.

The solution involves tracking mouse move events at browser level using JavaScript, and passing them to Flex. A handler in Flex will then scroll the application / component as you specify.

Here’s a detailed blog post and solution to scrolling Flex components / application with mouse wheel – in all browsers – all platforms.

It works well! Except that you can only scroll one way – either vertically (as in the code above) or horizontally (by hacking the code above!)

Wish Flex supports this by default someday! Would really help!

What do you think? Do you use mouse wheel / track pad to scroll?

Write a Comment

Comment

  1. Hi, we created an commercial, but very easy to use, component that enables scrolling on Mac and Safari PC but also fixes some weird behavior on PC is available here at http://www.zillizi.com.
    It doesn’t address diagonal scrolling though, which would very nice indeed.

  2. Very Nice!
    I have seen another solution in another website, but it is not in detail!
    Using a JavaScript may be a good solution!