MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE Reference page 583

Flash lite 2.x actionscript language reference
Hide thumbs Also See for FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE:
Table of Contents

Advertisement

The following examples describe the potential of using shared objects:
A Flash application can be used as a user interface for a service that enables 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 SharedObject 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
wait until the listener is invoked before attempting any operations.
Availability: ActionScript 1.0; Flash Lite 2.0
should
getLocal()
SharedObject
583

Advertisement

Table of Contents
loading

Table of Contents