[flexcoders] Resetting HSlider / VSlider

2009-04-16 Thread byte.sensei
I have a UI with filters including an HSlider with 2 thumbs representing a 
start year and end year (range 1854-2008). The HSlider code looks like this:

mx:HSlider id=slider_mfg_year minimum=1854 maximum=2008 thumbCount=2 
values=[1854,2008] labels=[1854, 2008] width=250 tickInterval=10 
snapInterval=1 dataTipFormatFunction={nf.format} liveDragging=false 
change=filter() horizontalCenter=0 bottom=5/

In addition, the UI has a reset button that is supposed to reset the filters 
to their default values. Everything is working *except* the HSlider -- I can't 
seem to get it to reset the thumbs to their default positions. I'm trying to do 
this by setting the thumb values:

private function filter_reset():void {
slider_mfg_year.values[0] = 1854;
slider_mfg_year.values[1] = 2008;
...

However, this doesn't seem to be resetting the thumb positions, just the 
HSlider control values, and the values/positions of the thumbs are now out of 
sync. 

How can I reset the HSlider thumbs back to their default positions/values?







Re: [flexcoders] Resetting HSlider / VSlider

2009-04-16 Thread thomas parquier
I think you have to set the values property to an array to have the setter
triggering some stuff.

thomas



2009/4/16 byte.sensei byte.sen...@yahoo.com



 I have a UI with filters including an HSlider with 2 thumbs representing a
 start year and end year (range 1854-2008). The HSlider code looks like this:

 mx:HSlider id=slider_mfg_year minimum=1854 maximum=2008
 thumbCount=2 values=[1854,2008] labels=[1854, 2008] width=250
 tickInterval=10 snapInterval=1 dataTipFormatFunction={nf.format}
 liveDragging=false change=filter() horizontalCenter=0 bottom=5/

 In addition, the UI has a reset button that is supposed to reset the
 filters to their default values. Everything is working *except* the HSlider
 -- I can't seem to get it to reset the thumbs to their default positions.
 I'm trying to do this by setting the thumb values:

 private function filter_reset():void {
 slider_mfg_year.values[0] = 1854;
 slider_mfg_year.values[1] = 2008;
 ...

 However, this doesn't seem to be resetting the thumb positions, just the
 HSlider control values, and the values/positions of the thumbs are now out
 of sync.

 How can I reset the HSlider thumbs back to their default positions/values?

  




-- 
http://www.web-attitude.fr/
msn : thomas.parqu...@web-attitude.fr
softphone : sip:webattit...@ekiga.net sip%3awebattit...@ekiga.net
téléphone portable : +33601 822 056