Easy Sound Player

package {
import flash.display.Sprite;
import flash.net.URLRequest;
import flash.media.Sound;
import flash.media.SoundLoaderContext;
import flash.events.IOErrorEvent;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.media.SoundChannel;
import flash.media.SoundTransform;

public class MainSoundplayer extends Sprite
{
private var snd:Sound = new Sound();
private var channel:SoundChannel;
private var trackTransform:SoundTransform = new SoundTransform(1.0);
private var muteBtn:Mute = new Mute();
private var unmuteBtn:Unmute = new Unmute();

public function MainSoundplayer() {
addEventListener(MouseEvent.CLICK,processStageClicks);
setupButtons();
loadSound();
}

function processStageClicks(evt:MouseEvent):void
{
switch(evt.target.name)
{
case "unmute":
unmuteSound();
break;
case "mute":
muteSound();
break;
default:
return;
}
}

function setupButtons():void
{
unmuteBtn.visible = false;
unmuteBtn.name = "unmute";
muteBtn.name = "mute";
addChild(unmuteBtn);
addChild(muteBtn);
}

function loadSound():void
{
var snd:Sound = new Sound();
var req:URLRequest = new URLRequest("http://mcshare.myblog.it/media/02/00/5297c6b1fb603a0768135788b1f99407.mp3");
var context:SoundLoaderContext = new SoundLoaderContext(3000, false);

snd.load(req, context);
channel = snd.play();
channel.soundTransform = trackTransform;
snd.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
}

function unmuteSound():void
{
trackTransform.volume = 1;
channel.soundTransform = trackTransform;
unmuteBtn.visible = false;
muteBtn.visible = true;
}

function muteSound():void
{
trackTransform.volume=0;
channel.soundTransform = trackTransform;
unmuteBtn.visible = true;
muteBtn.visible = false;
}

private function errorHandler(errorEvent:IOErrorEvent):void {
trace("The sound could not be loaded: " + errorEvent.text);
}
}
}

Buffer Mp3 sound

package {
import flash.display.Sprite;
import flash.net.URLRequest;
import flash.media.Sound;
import flash.media.SoundLoaderContext;
import flash.events.IOErrorEvent;

public class MainSoundplayer extends Sprite {

public function MainSoundplayer() {
var snd:Sound = new Sound();
var req:URLRequest = new URLRequest("http://mcshare.myblog.it/media/02/00/5297c6b1fb603a0768135788b1f99407.mp3");
var context:SoundLoaderContext = new SoundLoaderContext(3000, false);

snd.load(req, context);
snd.play();

snd.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
}

private function errorHandler(errorEvent:IOErrorEvent):void {
trace("The sound could not be loaded: " + errorEvent.text);
}

}
}

Link MouseOver sound

<script language="javascript" type="text/javascript">

function playSound(soundfile) {

document.getElementById("dummy").innerHTML=

"<embed src=""+soundfile+"" hidden="true" autostart="true" loop="false" />";

}

</script>

 <A HREF="YourPage.html" onmouseover="playSound('/wp-content/themes/quantum/beep_1.mp3');">Mouse over this text to hear a sound</A>