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”
Comments are closed.
ADVERTISEMENT
Join Make: Community Today
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.