Using sharedObject to store data at the client machine

July 18, 2007

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

Cairngorm Auto Code template generator

July 12, 2007

I know there are such tools available but building one is nice experience and then using it ­čÖé

We are using cairngorm framework in our project. I found generating the cairngorm module classes is repeatative and time consuming. To make my life easier, I written a small utility with PHP which allows me to generate this classes by specifying the package and module name. This one I had done for my project. This can be utilize to generate module classes for any project. Generated files needs very few modification that may differ from the personal preferences.

It help me saving the lots of copy paste time.

Click here to generate the cairngorm classes.

suggest me if anyway I can make it better.