nickhill
03-12-2009, 10:59 AM
Hi everyone, I appreciate I'm a new member and cheeky enough to ask for urgent help lol... but I'm a beginner and have a uni assignment due in tomorrow and I'm having trouble adding sound onto my webpage. I'm using this code:
var sound:Sound = new Sound();
var souddControl:SoundChannel = new SoundChannel();
sound.load(new URLRequest("coldplay_sample_mono.mp3"));// finds sound clip
sound.addEventListener(Event.COMPLETE, soundLoaded);
btnStop.addEventListener(MouseEvent.CLICK, stopSound);
btnPlay.addEventListener(MouseEvent.CLICK, replaySound);
function soundLoaded(e:Event): void {
soundControl = sound.play();
}
function stopSound(e:MouseEvent): void {
soundControl.stop();
}
function replaySound(e:MouseEvent): void {
soundControl = sound.play();
}
and I'm getting 3 1120 errors, one for each of the functions.... I'm lost. Thanks in advance.
var sound:Sound = new Sound();
var souddControl:SoundChannel = new SoundChannel();
sound.load(new URLRequest("coldplay_sample_mono.mp3"));// finds sound clip
sound.addEventListener(Event.COMPLETE, soundLoaded);
btnStop.addEventListener(MouseEvent.CLICK, stopSound);
btnPlay.addEventListener(MouseEvent.CLICK, replaySound);
function soundLoaded(e:Event): void {
soundControl = sound.play();
}
function stopSound(e:MouseEvent): void {
soundControl.stop();
}
function replaySound(e:MouseEvent): void {
soundControl = sound.play();
}
and I'm getting 3 1120 errors, one for each of the functions.... I'm lost. Thanks in advance.