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

Chapter 8. Navigation > Establishing Mutually Exclusive Options

Establishing Mutually Exclusive Options

The main difference between the CheckBox and RadioButton UI components is that radio buttons are designed to be mutually exclusive. That is, if one button in a radio button group is selected, all others are unselected. Used in situations where the designer requires a mutually exclusive or forced choice, the radio button has several applications. For example, in determining individual income, users are far more likely to respond if given a grouping of salary ranges, where only one choice is possible, than if asked to type in their exact annual salaries. Other groups are inherently mutually exclusive, such as gender. If a person is of one gender, she or he is not of the other gender. The following example shows what happens when you place radio buttons in a group where only a single button can be selected:

Open a new document with one layer named Actions and the other layer Radio Button.

Select the Radio Button layer, drag two RadioButton UI components to the Stage, and provide the instance name male_rb for one and female_rb for the other.

In the Parameters tab of the Component Inspector, select each component on the Stage and type “gender” for the groupName value. In the Value column of the label row, name one “Male” and the other “Female”.

Finally, select the first frame in the Actions layer and enter the following script:

//The radio group "gender" is placed in the
//Component inspector for each instance in
//the group but can be done with code. e.g.,
var radioListen:Object = new Object();
radioListen.click = function() {
    if (male_rb.selected == true) {
    } else {
gender.addEventListener("click", radioListen);



Not a subscriber?

Start A Free Trial

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