Using sharedObject to store data at the client machine

The sharedObject class is used to store and read data on user’s computer or on a server. Local shared objects can be used as browser cookies. You can also store custome object into the sharedObject, this problem I got resolved with the help of google flex_india group. Thanks for their quick help on this matter.

Follow the thread for discuss issue about storing the custome object in the sharedObject

http://groups.google.com/group/flex_india/browse_thread/thread/92362f8ee4df6c1a/23d620ed37d81503

You can create the local shared object with following syntax:
//Create “testLocalSharedObject”
var testSO:SharedObject = SharedObject.getLocal(“testLocalSharedObject”);

To store any data into the sharedObject use data property.

//This will store the  myname value, the same can be retrieved from it.
testSO.data.myname =”vijay khambalkar”;

//To store the this data into the local file, use flush method. This method writes the content immediately to the local file.
testSO.flush();

//To destroy object from the local file, use clear method. This method clears all the data from the sharedObject and deletes the sharedObject from the disk
testSO.clear()

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: