Control HSlider or VSlider with the Mouse Wheel
Line Break
Author: Arjan (34 Articles) - Author Website
Arjan is a SAP Consultant specialized in ABAP and Front End development techniques like Web Dynpro, Adobe Interactive Forms, Flex and AIR. In his free time he likes to create examples for Flex-Blog and other applications using Flex, AIR and PHP. Other hobbies are movies and music. He is also the co-owner of Flex-Blog.com.
When I was working on my Flex MP3 player I thought it would be nice to make it possible to control the volume slider with the mouse wheel. I started scrolling trough the events of the HSlider component and luckily, there is a standard event that is dispatched when a user uses the mouse wheel.
Using it is actually very simple, just put an event handler on the mouseWheel event of a H- or VSlider and do the appropriate coding there. We can use the event that we get to access the event data, in my example i’m using the event.delta property to set the VSlider to it’s new value. You can debug the event to view all the event properties and attributes.
Related posts:


