Search code examples
actionscript-3apache-flexflex4mxmlflex-spark

Force Flex 4 Spark Hslider snap to certain values?


I remember using values array on good old mx:HSlider, is there any workaround for s:HSlider?!

Basically I need slider to choose values between 300 and 2500 in following steps 300,500,1000,2000,2500.

<s:HSlider id="franchiser" 
   value="1500" 
   skinClass="components.HorizontalSlider" x="0" y="0" 
   minimum="300" maximum="2500" />

If not with this component, is there any alternative skinable slider out there?!

Thanks in advance!


Solution

  • The default HSlider does not have this functionality.

    To accomplish this, you will need to create a class that extends HSlider and adds this functionality.

    You can see an example of how to extend a Flex class here: http://blog.flexexamples.com/2008/09/08/extending-the-linkbutton-control-in-flex/