# addListener function on button (not component)

**URL:** <https://forum.kirupa.com/t/addlistener-function-on-button-not-component/77933>\
**Category:** flash\
**Created:** [January 31, 2005, 9:22pm UTC](https://forum.kirupa.com/t/addlistener-function-on-button-not-component/77933 "2005-01-31T21:22:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![frankybones](https://avatars.discourse-cdn.com/v4/letter/f/f04885/32.png) [@frankybones](https://forum.kirupa.com/u/frankybones)\
**Post date:** [January 31, 2005, 9:22pm UTC](https://forum.kirupa.com/t/addlistener-function-on-button-not-component/77933/1 "2005-01-31T21:22:31Z")

</div>

Hey all,

I want to be able to add a listener to a button (symbol) as opposed to a button component–so I can check to see which radio button is marked true. The following is what I have so far:

myLabel.setStyle(“color”,0xFFFFFF);  
radioBTN1.setStyle(“color”,0xFFFFFF);  
radioBTN2.setStyle(“color”,0xFFFFFF);  
radioBTN3.setStyle(“color”,0xFFFFFF);  
myForm = this;  
var submitBtnListener:Object = new Object();  
submitBtnListener.onPress = function() {  
var selectedRadioBtn = myContact.selection;  
var selectedRadioBtnLabel = selectedRadioBtn.label;

```
//I am using this as opposed to trace for confirmation of the script working
statusMessage.text = "You can be contacted best by " + selectedRadioButtonLabel;

```

}  
\_parent.submitBtn.addListener(submitBtnListener);

Thanks,

Franky B.
