# Help needed with switching sounds based on visibility

**URL:** <https://forum.kirupa.com/t/help-needed-with-switching-sounds-based-on-visibility/317842>\
**Category:** flash\
**Created:** [January 4, 2011, 3:38pm UTC](https://forum.kirupa.com/t/help-needed-with-switching-sounds-based-on-visibility/317842 "2011-01-04T15:38:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![justicity](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@justicity](https://forum.kirupa.com/u/justicity)\
**Post date:** [January 4, 2011, 3:38pm UTC](https://forum.kirupa.com/t/help-needed-with-switching-sounds-based-on-visibility/317842/1 "2011-01-04T15:38:15Z")

</div>

Hi, new around here so sorry if I’ve got anything wrong.  
I haven’t been using Flash long enough to know if I’m using Flash 8 Actionscript or Flash MX 2004 Actionscript, etc. I don’t really know the difference or where to look so an explanation about that would also be helpful.  
I do know I’m using Actionscript 2, in CS4.

Basically I’m needing help switching between sounds based on visibility of other items.  
I’ve got 15 buttons; buttons 1 to 5 making one of objects 1 to 5 visible and turning the others off, and buttons 6 to 10 and 11 to 15 doing the same for items 6 to 10 and 11 to 15 respectively.  
I’m trying to make three sounds play when a point on the timeline is met. Sound 1 is dependant on which of object 1 to 5 is visible, etc.

Everything I’ve tried has either not worked or ended up with sounds overlapping/playing oddly. I can’t find anything on the internet specific enough to help, so I thought I’d ask specifically.

How would you guys go about making this?  
As I’ve said, I’m relatively new to Actionscript. I’m doing a MultiMedia course at uni so I know what they’ve taught me, and I’ve worked out bits and pieces here and there on my own, but this one’s really stumping me.  
(This project isn’t for university.)
