The purpose of this tutorial is to present our custom HorizontalSlider (and VerticalSlider) classes that provide a light-weight, easily customizable alternative to the built-in slider component in Flash CS3. The component has the unfortunate side effect of adding a lot to the swf file size, especially if you need multiple sliders in one application. To show our sliders in action, we built a simple applet displayed below in which color tints are applied to a photograph.
- Download 'fla' and 'as' files corresponding to this tutorial: sliders.zip
The source code files are well-commented and the code should be easy to follow.
On the next page we discuss the script placed on the MainTimeline of sliders.fla in which the three sliders are instantiated and customized. We also show how the custom event, HorizontalSlider.SLIDER_CHANGE, dispatched by the class is used.