Let's perform the following steps to limit color values via the slider:
We have two color values to manipulate, so create two more variables with the names
color
andshade
. Turn each new variable into a slider control on the stage.Let's limit the input that the user can enter. Right-click on the color slider, and select the option set slider min and max. This will open a Slider Range dialog box as shown in the following screenshot:
In the Min and Max fields, enter
0
and199
respectively. Click on OK to save the range.Test the slider control out, and verify that you cannot select a value higher than 199.
Now incorporate the color and shade variables into the appropriate blocks in the script as shown in the following screenshot: