PDA

View Full Version : check for multiple values. "if(test == 1 or 2 or 3)"


cdrake
06-28-2005, 10:54 PM
on (release) {
if (_root.test == 1, 2, 3, 4, 5) {
trace("works");
} else {
trace("doesnt work");
}
}


It returns "works" no matter what test equals so I assuming the code if (_root.test == 1, 2, 3, 4, 5) is wrong.

Thanks

tg
06-28-2005, 11:13 PM
change to:

if(test==1 || test==2 || test==3 || test==4){
trace("works");
}else{
trace("doesn't work");
}

cdrake
06-28-2005, 11:43 PM
thanks.