SharedObject


 
Personalized wallpapers and screensavers for mobile phones

The SharedObject class in the flash lite lets Flash SWF files to save data to the device when it is closed and load that data from the device when it is played again. Flash Lite shared objects save a set of name-value pairs to the device.

Note: The name "SharedObject" is repeated from the Flash SharedObject class. The Flash version of this class allows a few Flash SWF files to share their saved data. But, the Flash Lite version of the SharedObject class does not support sharing data among different Flash SWF files.

In Flash Lite, a SWF file is considered to be a various version if it was changed from the original version, even if it has the identical name. in Flash Player, where a SWF file is considered to be the same if its URL and name are the identical, even if the SWF file was modified. In Flash Lite, two different versions of a SWF unable access each other's shared objects.
To keep consistency with the Flash platform, the same ActionScript build and calling conventions are used for the Flash Lite player.

The following examples explain the potential of using shared objects:

  • A Flash application can be used as a user interface for a service that gives the user to search used car listings. The application connects to a server that provides listings of cars based on the search terms and preferences that the user enters. The Flash application can save the last search the user made and prefill the forms the next time the SWF file is played. To do this, you create a haredObject instance that stores search parameters each time the user makes a new search. When the SWF file closes, the player saves the data in the shared object to the device. The next time the SWF file plays, the Flash Lite player loads the shared object and prefills the search form with the same search data the user entered the previous time.
  • A Flash application can be used as a user interface for a service that allows users to search for music reviews. The application lets users store information about their favorite albums. The information can be stored on the remote server, but this causes problems if the application cannot connect to the service. Also, retrieving the data from a remote service can be slow and detract from the user experience. Shared objects enable the application to store information about the albums to the device and load it quickly when needed. Note: Because space is limited on mobile devices, the data is not completely persistent; in some situations, the platform could delete the oldest data from the device.

To create a local shared object, use the following syntax:
var so:shared object = shared object.getLocal("mySharedObject");
Reading and writing data on a handset can be slow. To ensure that data is immediately available when the application requests it from the device, Flash Lite 2.0 requires you to set up a listener.
The player invokes the listener when the device has loaded the shared object's data.
Methods that access the SharedObject instance returned by the call to getLocal() should wait until the listener is invoked before attempting any operations.

More info here http://livedocs.macromedia.com

free mobile wallpapers 240x320

Back to Flash Lite home