• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 6. Basic Data Exchange > Saving Data with the Local Shared Object

Saving Data with the Local Shared Object

The local shared object enables you to save variables in a file on the user’s hard drive. This way, you can restore any variables saved during previous visits to your application. Local shared object files (LSOs, or SOLs as their file extension is .sol) are nearly identical to cookies, but offer one big advantage: Variables containing any Flash data type get restored to the same data type. Because cookies only support string data, storing other data types involves a “to string” conversion when saving and then a “from string” process when restoring—what a drag! If the variables in your LSO file contain arrays full of objects with nested strings (or anything really), they get restored just as you saved them. Another advantage LSOs have over cookies is your movie doesn’t have to be playing in a browser to work—Flash projectors can effectively read and write data to disk.

Note

Remote Versus Local

Later you’ll see how the Flash Communication Server supports remote shared object files (RSOs). Not only do RSOs remain on your sever, you also can share the contained variables with multiple simultaneous users. Really, however, the two differ in purpose: LSOs are for permanent storage between sessions, and RSOs immediately notify each user when another user makes a change to a variable. The good news, however, is they share similar syntax and data structures—so you’ll be able to apply what you learn in this chapter to other topics.



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint