# Radio button question

**URL:** <https://forum.kirupa.com/t/radio-button-question/250094>\
**Category:** Uncategorized\
**Created:** [January 25, 2008, 3:01pm UTC](https://forum.kirupa.com/t/radio-button-question/250094 "2008-01-25T15:01:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jay0316](https://avatars.discourse-cdn.com/v4/letter/j/9de0a6/32.png) [@jay0316](https://forum.kirupa.com/u/jay0316)\
**Post date:** [January 25, 2008, 3:01pm UTC](https://forum.kirupa.com/t/radio-button-question/250094/1 "2008-01-25T15:01:30Z")

</div>

I have a radio button group that is called Buckle and the labels are Plastic and Metal with the data set to “plastic” and “metal”. I have it set to default to the Plastic button, but if someone clicks “Metal” I’d like it to reveal a picture (instance name “pic”) of a Metal Buckle on the stage. I’m having trouble with the code. Could someone give me any advice?

//Buckle Radio Button  
Buckle.setChangeHandler(“onChange”);

//buckle function  
function onChange(component) {

//get value of the Buckle group  
buckle = Buckle.getValue();

//check to see if its data is metal, and if it is make the buckle visible. if not, hide it.  
if (buckle=“metal”) {  
setProperty(“pic”, \_visible, “1”);  
}else {  
setProperty(“pic”, \_visible, “0”);  
}  
}//end function
