User Guide

90 Button component
Using the Button component
A button is a fundamental part of any form or web application. You can use buttons wherever
you want a user to initiate an event. For example, most forms have a Submit button. You
could also add Previous and Next buttons to a presentation.
To add an icon to a button, you need to select or create a movie clip or graphic symbol to use
as the icon. The symbol should be registered at 0,0 for appropriate layout on the button.
Select the icon symbol in the Library panel, open the Linkage dialog box from the Library
pop-up menu, and enter a linkage identifier. This is the value to enter for the icon parameter
in the Property inspector or Component inspector. You can also enter this value for the
Button.icon ActionScript property.
To designate a button as the default push button in an application (the button that receives
the click event when a user presses Enter), use
FocusManager.defaultPushButton.
Button parameters
You can set the following authoring parameters for each Button component instance in the
Property inspector or Component inspector (Window > Component Inspector menu
option):
icon adds a custom icon to the button. The value is the linkage identifier of a movie clip or
graphic symbol in the library; there is no default value.
label sets the value of the text on the button; the default value is Button.
labelPlacement orients the label text on the button in relation to the icon. This parameter
can be one of four values:
left, right, top, or bottom; the default value is right. For more
information, see
Button.labelPlacement.
selected if the toggle parameter is true, this parameter specifies whether the button is
pressed (
true) or released (false). The default value is false.
toggle turns the button into a toggle switch. If true, the button remains in the down state
when clicked and returns to the up state when clicked again. If
false, the button behaves like
a normal push button. The default value is
false.
You can set the following additional parameters for each Button component instance in the
Component inspector (Window > Component Inspector):
NOTE
If an icon is larger than the button, it extends beyond the button’s borders.