I.
var numChildren:Number = canvas.numChildren - 1;
for (var i:int = 0; i < numChildren; i++) {
if (canvas.getChildAt(i).visible == true) {
canvas.getChildAt(i).visible = false;
}
}
II.
var numChildren:Number = canvas.numChildren - 1;
for (var i:int = 0; i < numChildren; i++) {
if (canvas.getChildAt(i).visible == true) {
canvas.removeChildAt(i);
}
}
The first block of codes works fine... However, with the second block
it returns this error: 'RangeError: Error #2006: The supplied index is
out of bounds.'
Can somebody tell me what's wrong? Thanks flexcoders!