# Quick Question (How to assign sound to combo boxes)

**URL:** <https://forum.kirupa.com/t/quick-question-how-to-assign-sound-to-combo-boxes/170086>\
**Category:** flash\
**Created:** [November 22, 2005, 6:02pm UTC](https://forum.kirupa.com/t/quick-question-how-to-assign-sound-to-combo-boxes/170086 "2005-11-22T18:02:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![twillis](https://avatars.discourse-cdn.com/v4/letter/t/b782af/32.png) [@twillis](https://forum.kirupa.com/u/twillis)\
**Post date:** [November 22, 2005, 6:02pm UTC](https://forum.kirupa.com/t/quick-question-how-to-assign-sound-to-combo-boxes/170086/1 "2005-11-22T18:02:40Z")

</div>

Hi,

I would like add some sound to each of my combo boxes when clicked on:

Would the code be something along the lines of this(ive already got my listener):

```auto
 
 
var my_sound:Sound = new Sound();
 
var myListener:Object = new Object();
myListener.change = function(){
 
my_sound.attachSound("CLICK1C");//clickSound is an mp3 file in the library
my_sound.start();
 

```

Heres my current code for combo box 1:

```auto
 
 
// combo box 1
listener1 = new Object(); // create an object to monitor the combo box
listener1.change = function() { //when the item selected in the combo box changes....
selNum[0] = num1.selectedIndex; // chosen number not available for selection in next combo box
num2.removeAll(); // clear the combo box
// swap enabled combo boxes
num2.enabled = true;
num1.enabled = false;
j = 0; // reset number for combo box
for (i=0; i<50; i++) { // numbers available for selection
num2.addItem(j, i); // add items 1 - 49 to the second combo box
j++; //increment item for second combo box
}
for (i=0; i<2; i++) { // numbers to be removed from the second combo box
num2.removeItemAt(selNum*); // remove the i(th) item from the combo box
}
gotoAndStop(2); // next frame
};
 
num1.addEventListener("change", listener1); // monitor the combo box
 

```

Thanks
