Mouse wheel programming in Javascript and Flash

Technology

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

What will the next generation of Make: look like? We’re inviting you to shape the future by investing in Make:. By becoming an investor, you help decide what’s next. The future of Make: is in your hands. Learn More.

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

ADVERTISEMENT

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

Prices Increase in....

Days
Hours
Minutes
Seconds
FEEDBACK