Shared Objects are used to store limited amounts of data on the device. It is smiliar to a browser cookie with two exceptions that it can store more complex data than simple text, and they do not expire by default.
Shared Objects have three important methods:
getLocal()haredObject - Used to create a locally persistant shared object or returns a reference if hasn't been previously created.
flush()tring - Immediately writes a locally persistent object to a local file.
clear():void - Destroys a shared object.
By default, <appname>.sol file which contains your SharedObject is stored within the application directory's data folder "<appname>/data/#SharedObjects/<appname>.swf/" when the flush() function is called.
Due to the BlackBerry® Tablet OS security model, an application can only play within its own sandbox and hence it's SharedObjects can't be accessed by other applications.
The following snippets of code illustrate the use of the SharedObjects:
// Creates the SharedObject variable. The SharedObject is created in // its default location <appname>/data/#SharedObjects/<appname>.swf/
public var sharedObj:flash.net.SharedObject; sharedObj = flash.net.SharedObject.getLocal("myJournal");
// Adding an Array List to the Object and saving the data