User Guide

ADOBE ATMOSPHERE 253
User Guide
fogToggle.onClick = function(state)
{
fog.active = state;
}
Slider
The Slider module enables a script to add sliders and progress bars to the browser’s Controls panel. Once created,
the sliders may be added and removed from the panel (so they may be, for instance, only made visible when they are
relevant). The script may also change their labels and values at any time. The script may query a slider’s value, or may
be notifi ed when it changes (typically when the user slides the tab or types a new value, but also when the script sets
the value directly) via the onChange() callback.
Global Methods
Slider(label)
Creates a Slider with the specifi ed label (optional). The Slider will not be added to the control panel until you
call add().
fogNearSlider = Slider(“Fog Near”);
Progress(label)
Creates a Progress Bar with the specifi ed label (optional). The Progress Bar will not be added to the control panel
until you call add().
lifeProgress = Progress(“Life Force Left”);
Properties
enabled
If set to false, greys the slider and makes it unavailable for use. (default = true)
fogNearSlider.enabled = false;
integersOnly
If true, the slider will accept and generate only integer values. False by default. (For progress bars do not set
integersOnly to false in the current release.)
// Drop-off expects only integers.
fogDropOffSlider.integersOnly = true;
label
The slider’s current label
fogNearSlider.label = “Fog Near”;
range
The min and max values the slider encompasses
fogNearSlider.range = [1, 100];