Click to See Complete Forum and Search --> : urgent action script 3.0 help needed :) error 1120


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.

TheBearMay
03-12-2009, 11:08 AM
Just glancing at it, could this be your problem:

var souddControl:SoundChannel = new SoundChannel();

Judging from the rest of your code it probably should be:

var soundControl:SoundChannel = new SoundChannel();