4 Replies Latest reply on Sep 16, 2008 4:47 AM by flynnc

    Flash newbe help:- User Specific Shared Object

    flynnc Level 1
      Hi,
      I am looking to create a shared object that is unique to each user but am unsure how to get this working.

      e.g.
      I have 2 users User A and User B.
      When User A runs the course from CD i want to create a shared object when they input their information (using information from certain input text boxes) called userA_so.
      If User B then runs the course I want to create a sencond shared object called userB_so
      and so on for further users.
        • 1. Re: Flash newbe help:- User Specific Shared Object
          heart_kub Level 1
          user = "heart_kub";
          var so:SharedObject = SharedObject.getLocal( user+"_mySO");
          • 2. Re: Flash newbe help:- User Specific Shared Object
            flynnc Level 1
            Hi heart_kub,
            Thanks for the reply.

            If I was to make the value of user = to a couple of input boxs (eg. box 1 and box 2) so each user details change the name of the box does this mean the code would be:

            user = box1+box2;
            var so:SharedObject = SharedObject.getLocal( user+"_mySO");

            Also,
            is it possbile to search to see if a shared object already exsists?
            • 3. Re: Flash newbe help:- User Specific Shared Object
              heart_kub Level 1
              you can use Object


              var so:SharedObject = SharedObject.getLocal("SO");
              if( so.data.record == undefined ){
              so.data.record = new Object();
              }


              //when you want to create data for uniq user
              so.data.record[userName] = new Object();

              so.data.record[userName].val1=0;
              so.data.record[userName].val2=0;
              so.data.record[userName].val3=0;


              if you want to search
              for(i in so.data.record){
              trace( i );
              }
              • 4. Re: Flash newbe help:- User Specific Shared Object
                flynnc Level 1
                Thanks heart_kub,
                but i am not sure it does what i am looking for, it may do and I just can't follow it.

                What I was meaning was that as the user enters the course they need to complete input boxes which captures surname, initials, and year of birth.

                I was wanting to combine the informtion in these boxes, eg, JASMITH74 and use this as the definition of the user.

                I was then wanting to create a shared object using this information eg JASMITH74_so.

                I would then use this shared object to capture subjects completed and quiz results.

                If the user could not complete the course in 1 go and returned later I wanted to be able to check if the shared object for that user exisits when they login and recover the data from the shared object.