# Loading Sound before playing

**URL:** https://forum.kirupa.com/t/loading-sound-before-playing/279665
**Category:** flash
**Created:** [January 17, 2009, 5:04am UTC](https://forum.kirupa.com/t/loading-sound-before-playing/279665 "2009-01-17T05:04:32Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![XJETRy](https://avatars.discourse-cdn.com/v4/letter/x/9d8465/32.png) [@XJETRy](https://forum.kirupa.com/u/XJETRy)
#### Post date: [January 17, 2009, 5:04am UTC](https://forum.kirupa.com/t/loading-sound-before-playing/279665/1 "2009-01-17T05:04:32Z")

</div>

I have created the following menu at [http://www.clevelandbrowns.cc](http://www.clevelandbrowns.cc/)

There are 8 letters in the menu. Each letter provides a link when clicked and a sound when rolled over. The letters will NOT APPEAR on stage until their corresponding sound is completed loaded. I did this to avoid distortion during playback. The sound bit are pretty small as well.

Anyway, the sounds are still distorted during playback and I don’t know why. They are all MP3. HELP PLEASE!! Here’s the script for one of the eight letters (movieclips) only to limit size you’ll have to look through:

public function Index() {  
var D:MovieClip = new dMC();  
D.x = 100;  
D.y = 275;  
var dURL:URLRequest = new URLRequest("[http://www.clevelandbrowns.cc/dawgblog");](http://www.clevelandbrowns.cc/dawgblog)  
var dtext:MovieClip = new dText();  
dtext.x = 758;  
dtext.y = 384;

\*\*var dSoundReq:URLRequest = new URLRequest("[http://www.clevelandbrowns.cc/audio/dSound.mp3");](http://www.clevelandbrowns.cc/audio/dSound.mp3)  
var dSound:Sound = new Sound();  
var dChannel:SoundChannel = new SoundChannel();  
dSound.load(dSoundReq);

```
		dSound.addEventListener(Event.COMPLETE, showD);
		function showD (evt:Event):void {
			addChild(D);
		}

```

D.addEventListener (MouseEvent.MOUSE\_OVER, playD);  
function playD (evt:MouseEvent):void {  
addChild(dtext);  
dChannel == dSound.play();  
}\*\*

```
		D.addEventListener (MouseEvent.MOUSE_OUT, stopD);
		function stopD (evt:MouseEvent):void {
			SoundMixer.stopAll();
			removeChild(dtext);
		}
		
		D.addEventListener(MouseEvent.CLICK, dLink);
		function dLink (evt:MouseEvent):void {
		navigateToURL(dURL, '_self');
		}

```

} // closes Index function
