How to Set the Value of a Slider

David Burgun dburgun at dsl.pipex.com
Thu Apr 8 06:57:56 EDT 2004


Hi All,

I have been messing around trying to find out how to set the Current 
Value of a Slider:

I have a button that does this:

on mouseDown
set the thumbPosition of Slider X to 22
end mouseDown

But when I run it, I get the following error:

     	executing at 11:51:31 AM
Type	Object: can't set object property
Object	Button 5
Line	set the thumbPosition of SliderX to 22
Hint	SliderX

I have a Slider that the user can drag, but they can also change it 
via a text field, e.g. if they set the field to 50 then I want the 
slider to go to 50.

The code I have for this is as follows:

on closeField
  set  the thumbPosition of SliderX to me
end closeField

But this give an error too!

I've looked thru the properties for Sliders and I expected to find a 
currentValue (to go with startValue and endValue) but didn't see one 
so I assumed that I have to use the thumbPosition property

Help!!

All the Best
Dave


More information about the use-livecode mailing list