Some favorite site feeds aggregated locally: iPhone Development RSS   Adobe Labs RSS   Macrumors RSS

Wednesday, July 8, 2009

AS3 range slider with multiple thumbs?

Wednesday, July 8, 2009    11 Comments

Update 2:
Here is a quick example of the working component as it stands right now. Implements setting thumb positions and all that jazz.



Update:
I started coding up an AS3 quasi-component and it's working pretty well. It's kind of hard-coded for my immediate needs, but I may just release it so you can implement custom events for it and roll it as a proper component.

It doesn't look like the sample below, the thumbs carry along their current value based on the max value set for the whole slider, use color-coded sections to better help visualize, etc.

If I get some spare time, I'll probably roll it into a proper component since it's not too hard but rather time-consuming. As most things I suppose.

If you are at all interested in using a range (partition) slider outside of Flex (that doesn't require Flex at all), then you may want to pay a little extra attention to this blog in the near future.

I've seen sliders, I've seen Flex sliders with two thumbs, but I have yet to see a slider that has more than two thumbs. I've been searching all over the place and I just haven't found one yet. I was hoping to locate one to save me the time and energy of coding one up myself from scratch. It's not terribly difficult, just really time consuming.

If you've seen one of these around, please let me know. I am hoping to save development time for my actual application and not having to cut out some of that time to create a multi-range slider.

Yes, I know the use case for a slider that can support 2+ thumbs is rare. Any help would be appreciated.

Here is an image of a component I already started:
slider
How I imagine it. The slider has a base min and max. Defaults to 1 thumb maybe. You can add thumbs and when you do you specify a value for it's initial placement.

To make it easy, any time any of the thumbs are moved, values for all are set for the change event, in the order of the thumbs, say an array of values. You can't drag a thumb over another thumb.

Labels: , ,