Me again, with radio buttons - am I a total idiot?

Okay, I didn’t think this was that hard since I was successful with a similar set of code using checkboxes . . .

I have two movie clips and two radio buttons. One radio button has initial value true and the other is false. The clip that goes with the “true” radio button is visible, the other has code . . .


onClipEvent(load){
	this._visible = false;}

All I want to do is have the appropriate radio button load the appropriate MC. What would be the appropriate code? I am using a Change Handler called “loadTemp” and am defining it as follows:


function loadTemp(){
	if(RadioButton1.getValue == 1){
		MC1._visible = true;
		MC2._visible = false;
	}
	else {
		MC1._visible = false;
		MC2._visible = true;
	}
	updateAfterEvent();
}

This lets me load MC2 but then when I go back to RadioButton1 nothing happens. I’m sure there is a better way - anyone? :tb:

Never mind, duh, I figured it out. This is what it needed for anyone else out there having trouble!

function radioDisplay(component) {
radio = component.getValue();
if (radio == “MC1”) {
MC1._visible = true;
MC2._visible = false;
} else {
MC2._visible = true;
MC1._visible = false;
}
}

groupName.setChangeHandler(“radioDisplay”);

good.
it’s always cool to see pple finding their own answers.
better than to get it server on a plate, this way you’ll know why & how.
for all others:
radio buttons come in groups, so that in the group,
only one can by selected, so if you want to use a few radios triggering the same function, give them the same group name.
getValue (as above) then tells you/the function which one is selected, and allows you to proceed from there.