Rather than having a long if statement, I want to use a for loop of some type to determine if a group of UI Checkboxes are are selected instead of a long draw out if statement. Once they are all selected I want to trigger another function.

So I have 5 check boxes


var checkboxListener:Object = new Object();
checkboxListener.click = function(evt_obj:Object) {
for (cb=1; cb<6; cb++) {
if (_root["c"+cb+"_ch"].selected) {
nextItem()
}
}

};
for (cb=1; cb<7; cb++) {
this["c"+cb+"_ch"].addEventListener("click",checkboxListener);
}
function nextItem() {
if (c1_ch.selected && c2_ch.selected && c3_ch.selected && c4_ch.selected && c5_ch.selected && c6_ch.selected) {
trace("all checked") }
}


Thanks in advance. I am publishing Flash 6 as 2.0