# Overlapping Sound Issue FL8/AS2

**URL:** https://forum.kirupa.com/t/overlapping-sound-issue-fl8-as2/235909
**Category:** flash
**Created:** [August 15, 2007, 6:34pm UTC](https://forum.kirupa.com/t/overlapping-sound-issue-fl8-as2/235909 "2007-08-15T18:34:13Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![shurleyn0va](https://avatars.discourse-cdn.com/v4/letter/s/e5b9ba/32.png) [@shurleyn0va](https://forum.kirupa.com/u/shurleyn0va)
#### Post date: [August 15, 2007, 6:34pm UTC](https://forum.kirupa.com/t/overlapping-sound-issue-fl8-as2/235909/1 "2007-08-15T18:34:13Z")

</div>

I have a button that is supposed to make one sound when an object is in range and another when it is not below is the code for the button.

the problem is both sounds play at once what am I missing here please help

//Attach Sound to Keypress  
on (keyPress “\<Space\>”) {  
alertSounds();  
getTimer();  
var reaction=getTimer()+",";  
trace (reaction+“reactionTime”);  
\_root.reaction\_txt += reaction;  
function alertSounds() {  
var posSound = new Sound  
var negSound = new Sound  
if (\_root.stimuli.\_x\>585);  
negSound.attachSound (“buzz”);  
negSound.start(0,1);  
if (\_root.stimuli.\_x\<=585);  
posSound.attachSound(“notify”);  
posSound.start(0,1);  
}  
}
