Hans Fredrik
Hans Fredrik

Reputation: 235

Actionscript 3 adding RadioButton to RadioGroup

Im kind of working a little in ActionScript 3.0 now. And after I found out I could write the code in Flash builder 4.6 and do the gui in Flash professional, thing got much smoother.

but as the title says, I have few RadioButtons on stage called rb1, rb2. Since Im coding in flash builder I need to reference them by writing : Public var rb1:RadioButton; and so on... That's not a problem, Now I Can reference to it by writing rb1.alpha / label/ or whatever I like. But get that button added to a group or reference to a group is the problem. If i make a group like : public var group123:RadioButtonGroup; and write group123.addRadioButton(rb1); it's not working. If someon wondering why I wan't to do it, it's because I want to set up a switch for the RadioButton for better code structure.

Hope anyone can help me!! :)

Upvotes: 0

Views: 522

Answers (1)

lexus.pp
lexus.pp

Reputation: 159

RadioButtons don't add to RadioButtonGroup as children. Use properties group or groupName of RadioButton.

rb1.group = group123;
rb2.group = group123;

Upvotes: 2

Related Questions