PDA

View Full Version : [AS3] CheckBox componet and Array


moglie
07-28-2009, 10:18 AM
I'm trying to put selected checkboxes into and array (check the checkbox and it's added to the array, uncheck it and it's removed. This is what I have. It's close but not quite 100%

function changeHandler(event:Event):void {
var pos=event.target.name;
if (event.target.selected==true) {
checkboxArray.push(event.target.name);
} else {
checkboxArray.splice(pos,1);
}
}