Id probably attack this problem in the following way.
Give each button an extra property describing its color,now when the user clicks the two buttons push them into an array maybe
Code:
btn1_btn.colored=blue;
btn1_btn.onRelease=function(){
myArray.push(this.colored);
}
and check to see if they are the same:
Code:
if (myArray[0]==myArray[1]){
//add to score
score ++;
trace("colours were equal");
//play mC animation
}else{
delete the array entries and start from scratch
myArray.length=0;
trace("Idiot, those dont match!");
}
This code would not work as it stands, it is just to help you get an idea. For instance you would need to define your array at the beginning etc etc.
GL,
Taff
Bookmarks