1 Reply Latest reply: Nov 5, 2014 8:08 AM by kglad RSS

    Recording Responses from Radio Buttons on different Frames

    navigator81 Community Member

      Hi Everyone ,

       

      Need some help in sorting this out , my knowledge of AS3 is very Basic , therefore for many , this question might be a lot dumb ;( but I am learning, as much as I can.

       

      Trying to Develop this Quiz , questions are scattered on different pages across the presentation., after few slides of Information , there is a set of questions and this pattern continues.

      Twist is , there is no Submit Button , so Answers are to be recorded and if the Answer is Correct , there is a Movie clip that would popup showing that answer is correct and only then user can move to the next slide.

       

       

      My Question re as follows :

       

      1 - how do I record the Responses from these Radio Button and then Count them all to see how many questions were answered correctly.?

      2 - Do I need to create Separate Groups of Radio Buttons for each page or can I keep them in one?

       

      BTW , I am doing all of this inside Flash CC and not using XML.

       

      Please shed some light on this so that I can make this quiz.

       

      Best regards

       

      Navigator.

        • 1. Re: Recording Responses from Radio Buttons on different Frames
          kglad CommunityMVP

          use variable(s) to keep track of user input when frame changes result in elimination of object instances.

           

          for example, if you have radio button groups in the first 10 frames of you quiz (ie, one group on each frame), and at the end of the quiz you want to tally the number first radio button responses, use something like

           

          var rb1_num:int;

          radiobutton1.addEventListener(MouseEvent.CLICK,rbF);

          radiobutton2.addEventListener(MouseEvent.CLICK,rbF);

          radiobutton3.addEventListener(MouseEvent.CLICK,rbF);

          radiobutton4.addEventListener(MouseEvent.CLICK,rbF);

           

          function rbF(e:MouseEvent):void{

          if(e.currentTarget==radiobutton1){

          rb1_num++;

          }