Summary
A slider is used to allow the user to visually select a numeric value within a range. onClick() can be used to receive notifications that the slider value has changed.
void setRange(min,max)
void setValue(value)
number getValue()
Example
root = new View("ipad-portrait");
slider = root.createSlider(400,200);
slider.setRange(10,30);
slider.setValue(80);
function click(sender) {
document.writeln("slider value " + sender.getValue());
}
slider.onClick(click);
document.wait();
setRange
Sets the value range for a slider or progress indicator
void setRange(min,max)
Parameters
min - minimum value for slider
max - maximum value for slider
Return Value
none
Notes
This method can also be used on a ProgressIndicator
setValue
Sets the current value for a slider
void setValue(value)
Parameters
value - number value for slider
Return Value
none
Notes
Method can also be used on ProgressIndicator
getValue
Return the current value for the slider
number getValue()
Parameters
none
Return Value
Current numeric value of the slider
Notes
You can use onClick() to receive notifications of user changes to the slider and then use getValue() to obtain the current value.