# Why won't my sound play?

**URL:** <https://forum.kirupa.com/t/why-wont-my-sound-play/311666>\
**Category:** Uncategorized\
**Created:** [July 13, 2010, 8:01pm UTC](https://forum.kirupa.com/t/why-wont-my-sound-play/311666 "2010-07-13T20:01:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lanawylma](https://avatars.discourse-cdn.com/v4/letter/l/58f4c7/32.png) [@lanawylma](https://forum.kirupa.com/u/lanawylma)\
**Post date:** [July 13, 2010, 8:01pm UTC](https://forum.kirupa.com/t/why-wont-my-sound-play/311666/1 "2010-07-13T20:01:25Z")

</div>

**Can someone please help me out with this… Why won’t my sound play? It should play on MousOver and stop on MouseOut… Thank you ahead of time!**

stop();

import flash.display.MovieClip;  
import flash.events.MouseEvent;

var req:URLRequest = new URLRequest(“squeeak.wav”);  
var sound:Sound = new Sound();  
var controller:SoundChannel;

function soundLoaded(event:Event):void  
{  
controller = sound.play();  
controller.stop();

this.addEventListener(MouseEvent.ROLL\_OVER, playSound);  
this.addEventListener(MouseEvent.ROLL\_OUT, stopSound);  
this.addEventListener(MouseEvent.CLICK, onClickHandler);  
this.addEventListener(MouseEvent.MOUSE\_DOWN, onPressHandler);  
this.addEventListener(MouseEvent.MOUSE\_UP, onReleaseHandler);

}

// if you want a hand cursor  
this.buttonMode = true;  
this.useHandCursor = true;

function playSound(myEvent:MouseEvent) {  
trace(“On”);  
this.gotoAndPlay(“one”);  
controller = sound.play();  
}  
function stopSound(myEvent:MouseEvent) {  
trace(“Out”);  
this.gotoAndPlay(“two”);  
controller.stop();

}  
function onClickHandler(myEvent:MouseEvent) {  
trace(“I waited for Press AND Release!!!”);  
this.gotoAndPlay(“three”);  
}  
function onPressHandler(myEvent:MouseEvent) {  
trace(“Press”);  
}  
function onReleaseHandler(myEvent:MouseEvent) {  
trace(“Release”);  
this.gotoAndPlay(“four”);  
}

sound.addEventListener(Event.COMPLETE, soundLoaded);  
sound.load(req);

🅱
