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

Local SharedObjects

It’s hard to pick a favorite new feature in Flash MX, but local SharedObjects has got to be one. Basically, local SharedObjects are like HTML cookies—but much more. They enable you to store data (securely on users’ hard drives) and then read that data later when they revisit your site. For example, if they’ve typed in their names the first time they visited your site, you can present them with a “Welcome back...” message when they return. The process is not only simple, but it requires no server technology. Naturally, like most things, coming up with a good strategy on how to use local SharedObjects takes a little more work.


The idea is that you store data in a generic object and then save that object in a special file on the users’ hard drives. Even the data types of the values in your generic object are retained. This is a big deal. Numbers are stored as numbers, arrays as arrays, and so on. Compared to all the other techniques that send and receive string-only data (such as loadVariables()), this is a major convenience. (In the “Advanced Local SharedObject Examples” section, you’ll see how easily different data types are stored .)


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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