3 Replies Latest reply on Oct 29, 2006 2:27 AM by Wholeo

    sharedObject only in Flash 6?

    Wholeo Level 1
      I downloaded the example file local_so.fla from this page:
      http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_16194
      Since I use Flash 8, it wanted me to save it as 8. I also updated the publish settings to export as Flash 8 with Actionscript 2. In the browser the local_so.swf in local_so.html does not work. Also fails if exported as Flash 7. But it does work when exported as Flash6, AS2. Why?
        • 1. Re: sharedObject only in Flash 6?
          Rothrock Level 5
          I don't think there were any changes in how SharedObject worked between Flash 6 and 7. I just flipped through my help files a bit and didn't see anything that said the behavior had changed either.

          Usually when somebody says, "Works in 6, not in 7 or 8" it is one of the following issues. The biggest change between the two is that capitalization matters and you can't do things like increment undeclared variables.

          So my guess would be that there is a variable that is spelled OneWay in one spot and oneWay in another, or some such.

          Also look for anything like myCount++ when myCount has never been defined before.
          • 2. Re: sharedObject only in Flash 6?
            NSurveyor Level 2
            SharedObject, instead of sharedobject.
            • 3. Re: sharedObject only in Flash 6?
              Wholeo Level 1
              SharedObject is it. I changed this line:
              myLocalSO = sharedobject.getLocal("flashcookie" );
              to this:
              myLocalSO = SharedObject.getLocal("flashcookie" );
              and the program works with Flash 8, published as Flash 8.
              I still haven't studied this deeply, but this is very encouraging. I was going to fiddle with the counter, but I guess the program does it with this line, before incrementing:
              myLocalSO.data.counter = 1;

              So thanks, both, for the tips!