0

I'm confused. SharedObject seems have two ways to store value in it, by data and setProperty():

so.data.foo = 'bar';

so.setProperty('boo', 'bar');

What's the different? And why doesn't it have getProperty()?

millimoose
  • 39,073
  • 9
  • 82
  • 134
  • This needs more context. What language / platform is this? What's `SharedObject`? – millimoose Jun 12 '13 at 23:35
  • Hi Millimoose, Thanks for your reply. Okay, I am using ActionScript 3.0 A shared object is similiar to a browser cookie however, they are not stored with the rest of your browsers cookies and are not deleted when the user deletes the regular cookies. I am just trying to save some data about clients. – user2160610 Jun 13 '13 at 13:30

1 Answers1

0

From the SharedObject reference: setProperty() marks a property as "dirty" in addition to setting it, which you need to do if you're using a remote SharedObject, as it tells the server that the value needs to be updated in other clients.

It's slightly more convenient than manually setting the property and then calling setDirty(), and there's obviously no need to for a similar getProperty() method, as the server doesn't need to be informed when you do that.

David Mear
  • 2,254
  • 2
  • 13
  • 21