Automatically check checkbox

hello,

i want to create some script that will automatically check a checkbox when all other checkboxes are checked (too much use of the word check) :glasses:

here is the code i have but im a newbie to actionscript:

if (checkOne.selected==true && checkTwo.selected==true && checkThree.selected==true && checkFour.selected==true && checkFive.selected==true)
{
compiled.selected=true;
}
else
{
compiled.selected=false;
}

can anybody help please.

thanks