So I have an array that has 14 values and I use a for loop to initialize all of their values to 0. I then have 14 buttons that when you rollout of each of them, it changes it’s corresponding value in the array to 1. For example:
var myArray:Array = new Array();
myArray[0];
for(i = 0; i <= myArray.length; i++){
myArray* = 0;
}
mybutton.onRollOut = function():Void{
myArray[0] = 1;
};
Now, with that given, all together I have 14 values in my array (myArray[0], myArray[1], etc.) and 14 buttons(1 for each array value). What I want to do is check to see if all of the values in the array are equal to 1 and if they are, trace something. I’m presently doing it like this:
this.onEnterFrame = function():Void{
for(i = 0; i <= myArray.length; i++){
if(myArray* == 1){
trace("It worked!");
delete onEnterFrame;
}
}
};
The problem is that when I do it this way, it traces as soon as I rollout of one button. If you recall, I have 14 buttons and as you roll out of each of them, it’s corresponding array value is set equal to 1. I want it to trace once all of the values in the array are equal to 1.
Any help would be greatly appreciated. Thanks!