# Controlling sound

**URL:** <https://forum.kirupa.com/t/controlling-sound/306956>\
**Category:** Uncategorized\
**Created:** [March 25, 2010, 5:47am UTC](https://forum.kirupa.com/t/controlling-sound/306956 "2010-03-25T05:47:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ponrhartman](https://avatars.discourse-cdn.com/v4/letter/p/82dd89/32.png) [@ponrhartman](https://forum.kirupa.com/u/ponrhartman)\
**Post date:** [March 25, 2010, 5:47am UTC](https://forum.kirupa.com/t/controlling-sound/306956/1 "2010-03-25T05:47:51Z")

</div>

hey there im trying to control sound but its being a pain, basically i have a movie clip and i want it to play a sound when you rollover it, but when you rollout the animation rewinds, im trying to make the sound not play when it rewinds, here is my code

this.onEnterFrame = function(){  
if(rewind == true){  
whoosh.setVolume(0)  
prevFrame();  
}  
}

this.onRollOver = function(){  
rewind = false;  
play();  
}

this.onRollOut = function(){  
rewind = true;  
whoosh.setVolume(0)  
}
