3 Replies Latest reply on Jun 7, 2011 12:01 PM by kglad

    SharedObjects and LocalConnection

    lmitchsmith

      I hope you can help, I am storing data to a sharedObject invoking the sharedObject thus:

      var mySharedObject = SharedObject.getLocal("userDataPrem", "{domainname}/demopremium/");

      {domainname}/demopremium/ - is the path to the location of my Flash files

       

      I have 10 buttons on a page that write to the sharedobject upon button click

       

      I am using a LocalConnection script to refresh the flash files on the page so that they retain the latest data.

      This works as expected, however, when opening up the same page in a  different tab the flash files do not update, this is also the case when I  open another domain with my SharedObjects in.

       

      The SharedObject name is different for each domain to eliminate the  possibility of a collision with the .sol files if they have the same  name.

      The solution I am looking for would enable each instance of the  website to continue to update even if opened in a different window.

       

      Any help would be greatly appreciated.

        • 1. Re: SharedObjects and LocalConnection
          kglad Adobe Community Professional & MVP

          sharedobjects are specific to each domain.  they can't be used across different domains.

           

          in view of the above, what does, "when opening up the same page in a  different tab the flash files do not  update, this is also the case when I  open another domain with my  SharedObjects in.", mean?

          • 2. Re: SharedObjects and LocalConnection
            lmitchsmith Level 1

            Sorry let me explain it more clearly

             

            I know that sharedObjects cannot be used across multiple domains That's not what I want to do or the problem I raised here.

             

            The sharedObjects are invoked and contained in 10 buttons on a page and a summary list.

             

            When a button is clicked the summary list updates and sharedObject numRuns increments +1, which is great, however, I am also using localConnection to refresh the flash elements (buttons and summary list) with _root.loadMovie(_root._url);

             

            This was a fix I put in place and works, however, if I open another window or tab in my browser and navigate to the same URL, the flash buttons and summary list do not refresh.  The first instance of the URL in my browser however will continue to work as expected.

             

            If I do try to update the summary list by clicking a button nothing happens however the sharedObject is being written to and collated as upon a page refresh the data is populated in the summary list as expected.

             

            I am led to think it may be my localConnection, maybe a conflict or it is just unreliable - I am targetting Flash Player 7.

            • 3. Re: SharedObjects and LocalConnection
              kglad Adobe Community Professional & MVP
              I know that sharedObjects cannot be used across multiple domains That's not what I want to do or the problem I raised here.
              do you have more than 1 sharedobject?

               

              The sharedObjects are invoked and contained in 10 buttons on a page and a summary list.

              a sharedobject reference is local to a timeline or class but is not contained in a button so i don't understand this.

               

              When a button is clicked the summary list updates and sharedObject numRuns increments +1, which is great, however, I am also using localConnection to refresh the flash elements (buttons and summary list) with _root.loadMovie(_root._url);

              localconnection is used to communicate with a different swf that a user is viewing at the same time as your main swf.