Hi beginnner AS3 here again,
Right now I’m working on a school project (which is due friday :crying:)
I keep having problems with my score and for some reason it doesn’t go to frame 9.
Here’s what I have:
//Siesta level_1
stop();
var Score = 0;
var juistMuziekje = -1;
var namesArray:Array = new Array(“koe”,“kat”,“kip”,“hond”);
speelmp3();
trace(juistMuziekje);
function speelmp3() {
var rndGeluid = Math.floor(Math.random()*4);
var mp3 = namesArray[rndGeluid]+“.mp3”;
juistMuziekje = namesArray[rndGeluid];
trace(mp3);
var snd:Sound = new Sound();
var req:URLRequest = new
URLRequest(mp3);
snd.load(req);
snd.play();
}
addEventListener(MouseEvent.CLICK,vergelijk);
function vergelijk(e:MouseEvent) {
var naam = e.target.name;
if (naam == juistMuziekje) {
trace(“goedzo”);
Score += 1;}
else{
trace(“helaas”);
Score -= 1;
}
if Score = -5;
gotoAndPlay(9);
}
Some things are in dutch, I apologize for that. I tried changing it but it only ended up with more errors. I hope it’s not too confusing.
I appriciate any help ^^