okay, this is killing me, I don't have the patience to sit here and toy with this anymore. Hopefully somebody out there can help me with this...
I have an array of mcs, I want to pass a random grouping of them to a function on the press of a button, I have this sitting in the first frame of my movie:
//variables
arraySize = 30
randomNumber = 0;
//functions
function prep (player) {
player._alpha=33;
};
function scaleup (player) {
player._alpha=100;
player._xscale=200;
player._yscale=200;
};
function scaledown (player) {
player._alpha=33;
player._xscale=100;
player._yscale=100;
};
//arrays
playerArray = new Array (_root.a1, _root.a2, _root.a3, _root.a4, _root.a5, _root.a6, _root.a7, _root.b1, _root.b2, _root.b3, _root.b4, _root.b5, _root.b6, _root.b7, _root.c1, _root.c2, _root.c3, _root.c4, _root.c5, _root.c6, _root.c7, _root.d1, _root.d2, _root.d3, _root.d4, _root.d5, _root.d6, _root.d7, _root.e1, _root.e2, _root.e3, _root.e4, _root.e5, _root.e6, _root.e7);
booleanArray = new Array (_root.arraySize);
I then have this on the button:
on (release) {
randCount = random (_root.arraySize - 1);
for (j=0; j < randCount; j++) {
_root.randomNumber = random(_root.arraySize - 1);
if (booleanArray[_root.randomNumber] != true) {
booleanArray[_root.randomNumber] = true;
}
else {
j--;
}
};
for (q=0; q < _root.arraySize; q++) {
if (booleanArray[q] == true) {
_root.novis(movieclipArray[q])
}
};
for (k=0; k < (_root.arraySize - 1); k++) {
booleanArray[k] = false;
}
}
when I debug the movie, I see the variables randCount and randomNumber updating, but the index values of booleanArray don't update. Anybody got any ideas?
tia
bugg
I have an array of mcs, I want to pass a random grouping of them to a function on the press of a button, I have this sitting in the first frame of my movie:
//variables
arraySize = 30
randomNumber = 0;
//functions
function prep (player) {
player._alpha=33;
};
function scaleup (player) {
player._alpha=100;
player._xscale=200;
player._yscale=200;
};
function scaledown (player) {
player._alpha=33;
player._xscale=100;
player._yscale=100;
};
//arrays
playerArray = new Array (_root.a1, _root.a2, _root.a3, _root.a4, _root.a5, _root.a6, _root.a7, _root.b1, _root.b2, _root.b3, _root.b4, _root.b5, _root.b6, _root.b7, _root.c1, _root.c2, _root.c3, _root.c4, _root.c5, _root.c6, _root.c7, _root.d1, _root.d2, _root.d3, _root.d4, _root.d5, _root.d6, _root.d7, _root.e1, _root.e2, _root.e3, _root.e4, _root.e5, _root.e6, _root.e7);
booleanArray = new Array (_root.arraySize);
I then have this on the button:
on (release) {
randCount = random (_root.arraySize - 1);
for (j=0; j < randCount; j++) {
_root.randomNumber = random(_root.arraySize - 1);
if (booleanArray[_root.randomNumber] != true) {
booleanArray[_root.randomNumber] = true;
}
else {
j--;
}
};
for (q=0; q < _root.arraySize; q++) {
if (booleanArray[q] == true) {
_root.novis(movieclipArray[q])
}
};
for (k=0; k < (_root.arraySize - 1); k++) {
booleanArray[k] = false;
}
}
when I debug the movie, I see the variables randCount and randomNumber updating, but the index values of booleanArray don't update. Anybody got any ideas?
tia
bugg