Hi everyone,
I wonder if anyone can help me. I’m creating a small guessing game where on stage there are 6 squares, and the user has to click on a square, and see if it’s the correct one (it should be a bit more exciting when it’s finished!)
The random answer is created using the math.random method and I’m using an array for the square movieclips. The problem I now have is with the IF/ELSE statements. Normally this wouldn’t be a problem for me, but seen as I’m calling a random movieclip, I’m stumped.
Please have a look at the following code, and the bit I need you boffins to look at is just after the if statement.
var myArray:Array = [mc_square01, mc_square02, mc_square03, mc_square04, mc_square05, mc_square06];
myArray[Math.floor(Math.random() * myArray.length)].addEventListener(MouseEvent.MOUSE_DOWN , chooseMe);
function chooseMe(event:MouseEvent):void {
if (WHAT GOES HERE??????){
reply_txt.text = "Good Job!";
event.target.alpha = .2;
} else {
reply_txt.text = "Try Again!";
}
}
Any help, as ever, is gratefully received. And thanks again to ‘thehat’ earlier for his actionscript wisdom.