can you spot what is wrong with my code
I have 3 checkboxes on scene 1 of the movie. When one is clicked the other 2
should be cleared. The initial value of the first checkbox (instance name is
biking) is set to true and the other 2 (walking and running) are set to
false.
At the moment all 3 can be checked - this should not be allowed by my code -
the code below is in an action layer frame 1 and the checkboxes have a
change handler set (called checkChanged, checkChanged2 and checkChanged3).
Points of interest I have noticed are:
1. The trace bit fails to execute if its put inside the if conditional.
2. I can get the trace to work inside the if conditional if I change the
double equals to a single equals
[as]
function checkChanged(){
trace("check box 1 changed");
if(this.selected == true){
_root.running.selected = false;
_root.walking.selected = false;
}
}
function checkChanged2(){
trace("check box 2 changed");
if(this.selected == true){
_root.biking.selected = false;
_root.walking.selected = false;
}
}
function checkChanged3(){
trace("check box 3 changed");
if(this.selected == true){
_root.biking.selected = false;
_root.running.selected = false;
}
}
[/as]
I really would like some light shed on this if you can please. Just a novice
though so please spell out in idiot proof language whats going on and how do
I get it to work. I know radio buttons is a better choice but this is a
learning exercise and a challenge I have set myself. I use Flash MX