Entrepreneur Geek

Nirav Mehta on life, technology and future

Scrolling with mouse wheel in Flex application – even on Mac

with 3 comments

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?

Related posts:

  1. Notification Components in Flex If you are building a Flex application, you may need...
  2. Auto Complete Text Component for Flex Was looking for ways to skin a combobox and found...
  3. Intelligent Time Duration / Estimate Slider in Flex (inspired from The Hit List) I wrote yesterday that I am working on a time...
  4. Collaborating in web application using SVN What would you do if you wanted to manage document...
  5. Card Deck Animation in Flex I was trying out a GTD application the other day...

Written by Nirav

April 14th, 2009 at 6:21 pm

Posted in Flex & Flash, JavaScript/CSS

Tagged with ,

 

3 Responses to 'Scrolling with mouse wheel in Flex application – even on Mac'

Subscribe to comments with RSS or TrackBack to 'Scrolling with mouse wheel in Flex application – even on Mac'.

  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.

    bas

    19 Apr 09 at 6:55 pm

  2. Thanks a lot man. So much for Flex as a cross-browser platform!

    Steve Kwan

    20 Apr 09 at 11:31 pm

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

    Norris Lin

    4 Dec 09 at 6:41 am

Leave a Reply