Hi Ned,
Thanks for your patience. I'm pulling my hair out now. This is the error message I'm getting every time I mouse_up:
ArgumentError: Error #1063: Argument count mismatch on TestGameOver_fla::MainTimeline/calculateProgress(). Expected 0, got 1.
Here's what I've done to date:
stop();
B18.addEventListener(MouseEvent.MOUSE_UP, calculateProgress);
B28.addEventListener(MouseEvent.MOUSE_UP, calculateProgress);
B38.addEventListener(MouseEvent.MOUSE_UP, calculateProgress);
var mcArray:Array = new Array();
mcArray = [B18, B28, B38];
var framesArray:Array = new Array();
framesArray = [2, 3, 4];
var gameOver = true;
function calculateProgress() {
for (var i:uint=0; i<framesArray.length;i++) {
if (framesArray != mcArray.currentFrame) {
gameOver = false;
break;
}
}
if (gameOver) {
gotoAndStop(2);
}
}
Message was edited by: MurrayHeasman
Keep your hair intact, otherwise some good stuff might leak out of what's beneath it.
The error is telling you exactly what the problem is. You have a function named calculateProgress that is not written to accept an argument, but it needs to be since you have event listeners calling it, and event listeners pass an argument
function calculateProgress(e:MouseEvent) {