The slider is one of the components that come with Flash CS5. We will use a slider to convert inches to centimeters. We will select the number of inches on the slider, then multiply the number of inches by 2.54 to get centimeters.
Start a new ActionScript movie.
From the menu select Window, Components (Ctrl+F7)
Select the Slider and drag it to the stage.
Open the property window and change the name to sldInches and the maximum to 100:
If you want, use the free transform tool to make the slider longer.
Create a text box and name it lblInches. Add a second text box named lblCM.
Write the code as shown below.
sldInches.addEventListener(MouseEvent.MOUSE_MOVE,showInches);
function showInches(e:MouseEvent): void {
lblInches.text=""+sldInches.value;
lblCM.text=""+sldInches.value*2.54;
} //showInches