# Need help (again) with radio buttons!

**URL:** <https://forum.kirupa.com/t/need-help-again-with-radio-buttons/30606>\
**Category:** Uncategorized\
**Created:** [September 11, 2003, 3:44am UTC](https://forum.kirupa.com/t/need-help-again-with-radio-buttons/30606 "2003-09-11T03:44:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lunatic](https://avatars.discourse-cdn.com/v4/letter/l/73ab20/32.png) [@lunatic](https://forum.kirupa.com/u/lunatic)\
**Post date:** [September 11, 2003, 3:44am UTC](https://forum.kirupa.com/t/need-help-again-with-radio-buttons/30606/1 "2003-09-11T03:44:10Z")

</div>

So I’ve been very successful with radios in the past but only using two movie clips, so the code looked like this:

```php

function radioDisplay(component) {
	radio = component.getValue();
	if (radio == "Blah") {
		_root.A._visible = true;
		_root.B._visible = false;
	} else {
		_root.B._visible = true;
		_root.A._visible = false;
	}
}\

```

Simple right? But what do I do if I have a whole group of movie clips? Do I have to repeat the code over and over where one is true and all the others are false?

As in:

```php

function radioDisplay(component) {
	radio = component.getValue();
	if (radio == "A") {
		_root.A._visible = true;
		_root.B._visible = false;
		_root.C._visible = false;
		_root.D._visible = false;
		_root.E._visible = false;
	} else {
		_root.B._visible = true;
		_root.A._visible = false;
		_root.C._visible = false;
		_root.D._visible = false;
		_root.E._visible = false;
	}
}\

```

etc. etc. for each one? That seems like a major pain. Someone out there must know an easier way?
