# Combo box sound

**URL:** <https://forum.kirupa.com/t/combo-box-sound/241032>\
**Category:** Uncategorized\
**Created:** [October 9, 2007, 3:02pm UTC](https://forum.kirupa.com/t/combo-box-sound/241032 "2007-10-09T15:02:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bern494](https://avatars.discourse-cdn.com/v4/letter/b/a183cd/32.png) [@bern494](https://forum.kirupa.com/u/bern494)\
**Post date:** [October 9, 2007, 3:02pm UTC](https://forum.kirupa.com/t/combo-box-sound/241032/1 "2007-10-09T15:02:31Z")

</div>

Hi  
Is it possible to add a sound to a combo box so when the user clicks an item from the drop down menu it plays a sound.  
I am using flash cs3 and use a xml file to load my pics.  
I have a xml connector and combo box and a movie clip loader components on stage. All are named and binded and works fine. In my action script I have a trigger added to my xml connector name. I also have imported a sound into the library and set the linkage to export for actionscript and both checked export in first frame and unchecked export in first frame  
I have tried the code below but it does not work.

\<code\>  
xcFrames.trigger();

var my\_sound:Sound = new Sound();

var myListener:Object = new Object();  
myListener.change = function(){  
my\_sound.attachSound(“sound\_fx\_2”);  
my\_sound.start();  
}  
cbNames.addEventListener(“change”,myListener);  
\</code\>

Bern
