newflasher
07-29-2006, 07:56 AM
hi all please help change the array to be 2d
var i = 0;
// array with the movie clips
var orderr = new Array(firstt, firstt2, firstt3, firstt4);
// keep track of the correct movie clips
for (var j = 0; j<orderr.length; j++) {
// store a variable with the position in each movie clip
orderr[j].j = j;
// each time you click a movie clip
orderr[j].onRelease = function() {
// you got the correct movie clip (correct orderr)
if (this.j == i) {
this.gotoAndPlay(2);
trace("correct!");
// another correct movie clip
i++;
// you got the wrong movie clip
if (i == orderr.length) {
_root.gotoAndPlay("finish");
trace("finished!");
}
} else {
_root.gotoAndPlay("end");
trace("wrong!");
}
};
}
thanks for the help
var i = 0;
// array with the movie clips
var orderr = new Array(firstt, firstt2, firstt3, firstt4);
// keep track of the correct movie clips
for (var j = 0; j<orderr.length; j++) {
// store a variable with the position in each movie clip
orderr[j].j = j;
// each time you click a movie clip
orderr[j].onRelease = function() {
// you got the correct movie clip (correct orderr)
if (this.j == i) {
this.gotoAndPlay(2);
trace("correct!");
// another correct movie clip
i++;
// you got the wrong movie clip
if (i == orderr.length) {
_root.gotoAndPlay("finish");
trace("finished!");
}
} else {
_root.gotoAndPlay("end");
trace("wrong!");
}
};
}
thanks for the help