Answered
If statements within component listener
Hi,
I am going to use two radiobuttons and have a selection using if -statement. When i test this script both the trace -commands are executet. Can anyone please tell me what i am missing. I want only one of the if-statements to execute when clicking the radiobuttons.
The script i am testing.
flashistListener = new Object();
flashistListener.click = function (evt){
//slask = evt.target.selection.data;
//trace(slask);
if (rb_default.selected = true) {
trace(">>>value<<<");
}
if (rb_no_default.selected = true) {
trace(">>>novalue<<<");
}
}
radioGroup.addEventListener("click", flashistListener);
I am going to use two radiobuttons and have a selection using if -statement. When i test this script both the trace -commands are executet. Can anyone please tell me what i am missing. I want only one of the if-statements to execute when clicking the radiobuttons.
The script i am testing.
flashistListener = new Object();
flashistListener.click = function (evt){
//slask = evt.target.selection.data;
//trace(slask);
if (rb_default.selected = true) {
trace(">>>value<<<");
}
if (rb_no_default.selected = true) {
trace(">>>novalue<<<");
}
}
radioGroup.addEventListener("click", flashistListener);