5 Replies Latest reply on Jan 19, 2007 11:46 AM by peterent

    Slider

    GeorgeWS Level 1
      I got the slider to default to 1 value but how do you do 2 thumb values?

      Thanks
      George
        • 1. Re: Slider
          peterent Level 2
          Extend a slider class (eg, HSlider) and set thumbCount=2 in the constructor.
          • 2. Re: Slider
            GeorgeWS Level 1
            I should have explained more. I have a slider that has 24 ticks representing 24 months. I have 2 thumbs and I have it working calling a RO and returning new data to the grid. VERY COOL. My problem is that when you get to the application I want the thumbs to be set to the current month. So thumb 1 would be set at like 13 and thumb 2 would be set at 14. I was able to set the value of one of the thumbs but not the second.

            Thanks
            George
            • 3. Re: Slider
              generate_random_num
              Instead of

              slider.value=number

              use:

              slider.setThumbAt(0,number)
              slider.setThumbAt(1,number)

              the first parameter is the thumb; second is the position.
              • 4. Re: Slider
                GeorgeWS Level 1
                Looks good. But I dont know where to put that. I dont have the first statement in my slider. I would think that I can:
                <mx:HSlider id="mySlider" thumbCount="2" values="10,13"/>

                But that does not work. If I put just 13 one of the Thumbs starts at 13, so thats good, But cant set 2 of them. I really want the current month to decide what the Values are. Any thoughts

                Thanks
                George
                • 5. Re: Slider
                  peterent Level 2
                  When a slider has more than one value you can use its values (note the plural):

                  slider.values = [13,14];

                  The values property is an array where each element corresponds to a thumb from left to right (or bottom to top).