2 Replies Latest reply on Sep 1, 2007 6:00 PM by gajtguy

    Radiobutton - determining which of group is selected

      I can't for the life of me figure out how to determine which individual radiobutton is 'dotted'. I have two radiobuttons in the same group and I want them to make a certain movieclip object visible. So you choose RB1, MC1 is to become visible. Choose RB2 and MC2 becomes visible. Of course, while making MC1 visible I'd also like MC2 to hide and vice versa.

      Also, there is a replay button which needs to determine which RB is 'dotted' so it can actually play the appropriate visible MC.

      I've tried to code this a dozen different ways. The attached code is just my latest attempt. Please provide some clarity if you would. argh... Thanks

        • 1. Re: Radiobutton - determining which of group is selected
          The eventObj that is being passed has a target property.

          eventObj.target._name will give you the instance name of the radio button you selected.

          • 2. Re: Radiobutton - determining which of group is selected
            gajtguy Level 1

            Thanks for putting me on the right path. It would seem that I had the event listener assigned to the Radio 'groupname'. And in that case the eventObj returned the same name each time which happened to be the 1st choice of the group. So I created two event listeners, one for each individual radio item and then adjusted my code accordingly.

            However, that lead me to another dilema. How does the 'replay' button determine which radiobutton is the current 'dotted' selection. And for that I could only come up with a variable that holds the name of the last radio selected. Seems there should be another way to do this but I'm at a loss.

            If anyone feels like helping some more with these radio buttons, feel free. Thanks.