03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

this.onEnterFrame = function () {<br />

Selection.setFocus("myText_txt");<br />

Selection.setSelection(0, 1);<br />

delete this.onEnterFrame;<br />

}<br />

SharedObject<br />

Object<br />

|<br />

+-SharedObject<br />

public dynamic class SharedObject<br />

extends Object<br />

The Flash Lite version of the SharedObject class allows Flash SWF files to save data to the<br />

device when it is closed <strong>and</strong> load that data from the device when it is played again. Flash Lite<br />

shared objects store a set of name-value pairs to the device.<br />

Note: The name "SharedObject" is derived from the Flash SharedObject class. The Flash<br />

version of this class allows multiple Flash SWF files to share their saved data. However, the<br />

Flash Lite version of the SharedObject class does not support sharing data between different<br />

Flash SWF files.<br />

In Flash Lite, a SWF file is considered to be a different version if it was modified from the<br />

original version, even if it has the same name. This is different than in Flash Player, where a<br />

SWF file is considered to be the same if its URL <strong>and</strong> name are the same, even if the SWF file<br />

was modified. In Flash Lite, two different versions of a SWF file can't access each other's<br />

shared objects.<br />

To maintain consistency with the Flash platform, the same ActionScript construct <strong>and</strong> calling<br />

conventions are used for the Flash Lite player.<br />

The following examples describe the potential of using shared objects:<br />

■ A Flash application can be used as a user interface for a service that enables the user to<br />

search used car listings. The application connects to a server that provides listings of cars<br />

based on the search terms <strong>and</strong> preferences that the user enters. The Flash application can<br />

save the last search the user made <strong>and</strong> prefill the forms the next time the SWF file is<br />

played. To do this, you create a SharedObject instance that stores search parameters each<br />

time the user makes a new search. When the SWF file closes, the player saves the data in<br />

the shared object to the device. The next time the SWF file plays, the Flash Lite player<br />

loads the shared object <strong>and</strong> prefills the search form with the same search data the user<br />

entered the previous time.<br />

SharedObject 551

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!