Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with Checkboxes in Flash 8

Status
Not open for further replies.

Hskrdoo2007

Instructor
May 17, 2007
1
US
I am trying to create a multiple choice question. I have three checkboxes and two are correct. There are three checkboxes on the stage: check1_cb, check2_cb and check3_cb. The problem is that if they check all three checkboxes it still tells them that they are correct. I guess because check1 and check2 are still checked.

Here is my code:

black_btn.onRelease = function(){
if (check1_cb.selected && check2_cb.selected) {
answer_txt.text="You are correct!";
} else {
answer_txt.text="You are an wrong!";
}
}

How do I make it recognize that in order for it to be correct it, check 1 must be selected, check2 must be selected and chec3 must be DESELECTED.
 
black_btn.onRelease = function(){
if (check1_cb.selected && check2_cb.selected ) {
answer_txt.text="You are correct!";
}
if (check1_cb.selected && check2_cb.selected && check3_cb.selected ) {
answer_txt.text="You are an wrong!";
}
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top