canarybirdfly
05-13-2010, 06:10 PM
I've been trying to get sounds to work in AS3 I've been importing them and applying Linkage as you do but for some reason they haven't been playing, or only one plays when called.
Code below, can anyone think as to what I'm doing wrong?
function killKoala(temp) {
temp.visible = false;
gameOver = true;
var cs:explosionID=new explosionID
setChildIndex(gameOver_mc, numChildren - 1);
setChildIndex(restart_btn, numChildren - 1);
gameOver_mc.visible = true;
gameOver_mc.gotoAndPlay(1);
}
function exitKoala(temp) {
// remove temp koala from koala array
var index:int = koalas.indexOf(temp);
koalas.splice(index, 1);
//temp.visible = false;
temp.gotoAndStop("stand")
temp.x=40*rescuedTotal+180;
temp.y=20;
// move to rescued array
rescued.push(temp);
//plays Bonza sound from Koala
var cs:savedID=new savedID
cs.play();
// remove event listener
temp.removeEventListener(Event.ENTER_FRAME, moveKoala);
}
Code below, can anyone think as to what I'm doing wrong?
function killKoala(temp) {
temp.visible = false;
gameOver = true;
var cs:explosionID=new explosionID
setChildIndex(gameOver_mc, numChildren - 1);
setChildIndex(restart_btn, numChildren - 1);
gameOver_mc.visible = true;
gameOver_mc.gotoAndPlay(1);
}
function exitKoala(temp) {
// remove temp koala from koala array
var index:int = koalas.indexOf(temp);
koalas.splice(index, 1);
//temp.visible = false;
temp.gotoAndStop("stand")
temp.x=40*rescuedTotal+180;
temp.y=20;
// move to rescued array
rescued.push(temp);
//plays Bonza sound from Koala
var cs:savedID=new savedID
cs.play();
// remove event listener
temp.removeEventListener(Event.ENTER_FRAME, moveKoala);
}