Mouse wheel programming in Javascript and Flash


It’s an underused feature, but you can give your Flash and AJAX/Javascript applications basic mouse wheel support that works across most common browser platforms. Google Maps’ mouse zoom feature is a good example of how useful this small addition can be. If you’re programming an application where zooming or scrolling is a common task, give your users a break and don’t overlook this one.

On the Javascript side, Adomas Paltanavicius has put together a thorough overview and some example code for making this work in your application. You can capture wheel scroll events in IE, Safari, Firefox and Opera.

For Flash, you need to do some Javascript to Flash communication to capture mouse events on the Javascript side, and then make the data available from within the running Flash application. The SWFMacMouseWheel library provides the necessary glue to do all of this, bundling the Javascript listener code and an Actionscript event object into an easy to use package.

Mouse wheel programming in JavaScript – Link
SWFMacMouseWheel: use the mouse wheel in Flash – Link

2 thoughts on “Mouse wheel programming in Javascript and Flash

  1. sense says:

    When I first read this I took it as only being able to work with Mac’s. But reading the comments on the other page it does infact work with PC’s.

Comments are closed.

Discuss this article with the rest of the community on our Discord server!


Maker Faire Bay Area 2023 - Mare Island, CA

Escape to an island of imagination + innovation as Maker Faire Bay Area returns for its 15th iteration!

Buy Tickets today! SAVE 15% and lock-in your preferred date(s).