AS3 UI Components

AS3 UI Components

I’ve been using these user interface components for a few years now, tweaking them as projects come and go. Click on the image above or here to see a working example of my ToggleButtonBase, ButtonBase, SliderBase, ToolTipBase and ScrollBase AS3 classes.

ButtonBase is a multistate button that works by extending a MovieClip in the Flash library with ButtonBase.as as the base class. It means the various visual states are controlled on the IDE timeline (see the gratuitous green button).

ToggleButtonBase uses two instances of ButtonBase and dispatches ToggleEvents when the user changes it’s state.

SliderBase dispatches SliderEvents which contain a ‘value’ property that changes from 0-1 as the user drags the slider from left to right.

ScrollBase takes various display objects (background sprites, content display object, and 2 or 3 ButtonBase instances) to create a vertical content scroller. See ComponentTestDoc.as for examples of how to do this.

The source files are zipped here if you want to have