Components

Flash provides a set of user interface (UI) elements in the form of components. A number of these are analogous to form elements that appear in an HTML page, such as buttons, checkboxes, radio buttons, etc. There are two categories of components for ActionScript 3.0, User Interface and Video. Components are actually scripted movie-clip symbols.

Using Button Components

Choose Window>Components. If not already expanded, expand the list of user-interface components. Drag an instance of the button component onto the Stage. to view the varoius states of the button component, including the effect of any parameters set, choose Control>Test Movie and then interact with the button using the mouse.

To modify button component dimensions

To modify dimensions, in the Position and Size section of the Property Inspector, use the W and H setting - to link/unlink these two values, click the chain-link icon. You can also resize the button component using the Transform panel or the free-transform tool.

To modify button labels

Select the instance of Button. Access the Component Inspector (Window>Component Inspector) -- it has 3 sections Parameters, Bindings, and Schema. Click on the Parameters tab and type an entry next to the parameter Label.

To set the button component to act as a toggle

Selec the instance, access the Component Inspector, click on the Parameters tab, and choose true next to the parameter toggle. (the resulting differences in appearance seem very small, but we shall see below how to change this through modifying the skins)

Modifying a Component through Modifying Its Parts (skins)

When you drag an instance of the button componentt to the Stage, Flash adds the button component and a Component Assets folder to the library of your document. Inside this folder is a subfolder containg the component's skins. You can modify these underlying symbols, as you would any symbol, to change the look of the component. Changes to the component's skins will affect every instance of the component in your movie.

Scripting the Button Component

You can apply ActionScript to the button component just the way you would if it were a button symbol.

Revised August 10, 2010; Source: Flash CS4 Professional Visual QuickStart Guide, Katherine Ulrich, pp. 408-414,