Button control

The Button control is a commonly used rectangular button. Button controls look like they can be pressed, and have a text label, an icon, or both on their face. You can optionally specify graphic skins for each of several Button states.

You can create a normal Button control or a toggle Button control. A normal Button control stays in its pressed state for as long as the mouse button is down after you select it. A toggle Button controls stays in the pressed state until you select it a second time.

Buttons typically use event listeners to perform an action when the user selects the control. When a user clicks the mouse on a Button control, and the Button control is enabled, it dispatches a click event and a buttonDown event. A button always dispatches events such as the mouseMove, mouseOver, mouseOut, rollOver, rollOut, mouseDown, and mouseUp events whether enabled or disabled.

The following example shows a Button control:


Button control

You can use customized graphic skins to customize your buttons to match your application's look and functionality. You can give the Button control different image skins for the up, down, and disabled states, and the skins for these states can differ depending on whether the button is selected or not selected. The control can change the image skins dynamically.

The following example shows seven Button controls to control video recording and playback arranged in an HBox layout container. All buttons are in their up state.


HBox container with 7 ImageButton controls

The Button control has the following default properties:

Property

Default value

Default size

A size large enough to hold the label text, and any icon

Minimum size

0

Maximum size

No limit

Subtopics

Creating a Button control
Skinning a Button control

Flex 2.01

Take a survey


 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flex/201/html/controls_059_04.html