1 Reply Latest reply on Feb 3, 2009 11:57 AM by kglad

    Shared object not working

      I can not get a shared object to work at Flash 7. I am followoing the example at technote tn_16194 link http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_16194&sliceId=2
      The flash example seems to work fine in Flash 6 but not in Flash 7, after testing the movie several times, it seems to me that the problem is in loading the values from the shared object back to the movie. lines such as
      userName.text = myLocalSO.data.name;
      numVisits.text = "You have been here " + myLocalSO.data.counter + " times."
      are not getting the values. Any idea on what I need to change in order to get the shared object in the exapmle to work in Flash 7 as well.

      Many Thanks,


      Following is the code in the example I am reffering to.
      //create the local Shared Object
      myLocalSO = sharedobject.getLocal("flashcookie" );

      //Populate the text field if the SO already contains a name
      if (myLocalSO.data.name != null) {
      userName.text = myLocalSO.data.name;
      numVisits.text = "You have been here " + myLocalSO.data.counter + " times."
      //Populate the text fields if the SO does not contain a name
      else {
      userName.text = "<type your name here>";
      numVisits.text = "This is your first visit.";
      myLocalSO.data.counter = 1;

      //update counter for number of visits