4 Replies Latest reply on Jun 18, 2009 10:32 AM by Handycam

    Keeping track of user's choices

    Handycam Level 1

      I have an app with a series of screens with multiple choice questions, presented in spark lists.

       

      I have events and such in place to record what the user has chosen (selectedIndex is all I need) for each step.

       

      I have a function wired up in the main app to receive these and increment what I am calling "buckets" for simplicity:

       

      private function putIntoBucket(bucket:uint):void {
           switch (bucket){
                case 1:
                     choice1++;
                     break;
                case 2:
                     choice2++;
                     break;
                case 3:
                     choice3++;
                     break;
                case 4:
                     choice4++;
                     break;
                case 5:
                     choice5++;
                     break;
           }
      }
      

      All is well, it is counting the number of choices. 

       

      However, the "powers that be" have now requested the ability to go backward (previous step) and make a change.  So now I need to change this to realize if the user has made a different choice and, if so, take one out of one bucket and put it into the proper bucket.

       

      I am working on a variety of way, but am striving to keep it simple.  Any suggestions appreciated.