23 Apr 2005
Using Flash’s Local Shared Objects for Good, Not Evil
As you may know if you’re a Flash developer, recent versions allow movies to store data (up to 100KB by default) in Local Shared Objects. Only movies on the same server can access each other’s data, and users can manage or disable LSOs.
Recently, advertisers have started to use this feature to track users even when ordinary browser cookies are disabled. Perhaps Macromedia should’ve played safe with privacy and (if possible) only allowed Flash movies to use LSOs if embedded into a page on the same domain (preventing tracking across sites), but I can understand why they wouldn’t want to restrict it.
Anyway, even if you’re a Flash developer you might not have considered using LSOs to add useful touches with a few simple lines of code, e.g. to:
- Remember sound volume or on/off settings (quoteplay stores volume in an LSO).
- Keep track of the user’s highest score achieved so far in a game without needing server-side coding (can’t believe I’ve overlooked this one in the past).
- Store the last ‘page’ viewed in an all-Flash site, so the user doesn’t lose their place if they leave and return (often with accidental use of the Back button).
- Skip intro animations or transitions after the first viewing, so your fancy slide-out navigation menu doesn’t drive people barmy (you can store the date in the LSO and show the animation again if the user returns at a later date).
- Track users’ progress when browsing a site and offer content/navigation based on what they’ve already done (again, without requiring server-side coding or cookies; simply get each page to pass a URL or other identifier into the Flash via the embedding markup).