4 Replies Latest reply on Apr 30, 2007 9:47 AM by Newsgroup_User

    can read/write Shared Object locally, but never in a browser..

    Level 7
      Ok, I've googled till my fingers bled, and I'm still stumped. Have you
      all seen anything like this?

      I've got the following code:
      ------------------------------------------------------
      var so:SharedObject = SharedObject.getLocal("status");

      if (! so.data.seenIt){
      so.data.seenIt = true;
      so.flush();
      }else{
      this.gotoAndPlay('end');
      }
      ------------------------------------------------------

      Its only purpose is to skip an intro animation if a user has already
      seen it.

      This code works flawlessly on the local system in flash player. It
      fails every time in IE7 and Firefox. It fails when published to a
      remote server, and when loading a plain old html file from disk with the
      flash file in it.

      My flash plugin has its settings to allow 100k of shared objects, and it
      claims to be using about 3k.

      I've tried ...getLocal("status", "/"); though I shouldn't have to, and:
      if(so.data.seenIt == undefined){

      same symptoms resulted.


      Thanks!
        • 1. Re: can read/write Shared Object locally, but never in a browser..
          Optikalefx Level 1
          what does getLocal() return to you ?
          • 2. Re: can read/write Shared Object locally, but never in a browser..
            Optikalefx Level 1
            nah i dont even care, heres what i would do

            use php to get the users IP address. record it to a sql database. when the flash file is loaded have it send to a php script that checks the IP address with the database, if it finds a match return a variable back to flash with 'yes' and if if it doenst find a match return a variable back to flash with 'no' and then add the IP adress to the database. In flash have an if else statement with loadVariables. if variable from php is yes goto next, if else play it.
            • 3. Re: can read/write Shared Object locally, but never in a   browser..
              Level 7
              Optikalefx wrote:
              > what does getLocal() return to you ?


              var so:SharedObject = SharedObject.getLocal("status");
              trace(so);

              if (! so.data.seenIt){
              so.data.seenIt = true;
              so.flush();

              }else{
              this.gotoAndPlay('end');
              }

              -----------------------------------------------------
              trace(so);
              gives me [object Object], but as I can't trace from within the plugin
              (which is where the problem is) I don't know if that's still true there.
              • 4. Re: can read/write Shared Object locally, but never in a   browser..
                Level 7
                Optikalefx wrote:
                > nah i dont even care, heres what i would do
                >
                > use php to get the users IP address. record it to a sql database. when the
                > flash file is loaded have it send to a php script that checks the IP address
                > with the database, if it finds a match return a variable back to flash with
                > 'yes' and if if it doenst find a match return a variable back to flash with
                > 'no' and then add the IP adress to the database. In flash have an if else
                > statement with loadVariables. if variable from php is yes goto next, if else
                > play it.
                >


                Yeah, I'm about to do that out of desperation.. (cept with cookies and
                no DB) but that's a bit of a kludge and it's overkill for the thing I
                want. Additionally, it's not portable. You can't just hand someone the
                flash file and be done with it.

                In my endless googling, I've come across countless people with the same
                (generally more complex) code, and they seemed to have no problems.

                : (