• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 17. Adding Display Components > Adding a Radio Button

Adding a Radio Button

The RadioButton component lets you do something that the CheckBox component cannot do: force a user to make a single choice within a set of choices. The RadioButton component must be used in a group of at least two RadioButton instances, and only one member of the group can be selected at any given time. Selecting one radio button in a group will deselect the currently selected radio button in the group. For example, Gender: Male, Female. There can be only one answer to that question, so you would group the two items using RadioButton components.

Add a RadioButton Component

Open the Components panel.

Click the UI Components Expand triangle.

Drag one or more RadioButton components onto the Stage, and then select one at time.

Did You Know?

A visitor can control a radio button selection with the keyboard. Click the Tab key until one of the buttons within the group receives focus (is selected), and then use the left and right arrow keys to change the selection within the group. Having the ability to use the keyboard makes Flash components compliant with the current rules on accessibility as set by the U.S. Congress.


Open the Component Inspector panel, and then select the Parameters tab.

Select from the following RadioButton parameters:

  • data. Click the value field, and then enter a value that will be used to populate the RadioButton.

  • groupName. Click in the value field, and then enter a group name for the button. When you associate a group name to several RadioButton components, the visitor will only be able to select one button in the group.

  • label. Click the value field, and then enter a label for the RadioButton.

  • labelPlacement. Click the value field, and then select between right, left, top, or bottom for the placement of the label text.

  • selected. Click the value field, and then select between true (field appears selected), or false (field appears unselected).

Click the Control menu, and then click Test Movie.

Since the RadioButton components both use the same Group name, you can only select one button.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint