Chapter 17. SharedObjects

Persistent data and the communication of data play an integral part in how users experience an application. Persistent data, such as data stored and accessed by your application from an online service or the local file system, affords you the capability to store state information within multiple sessions from which a user will use your application. When communicating data between your application and another application, information is relayed to affect the current session state within either application. Though an online service can provide such communication of live and persistent data, your web-based applications may require a more-local approach,

Data can be stored on a user’s local hard disk by using a SharedObject. A SharedObject functions very much like a browser cookie and enables your Flex application to store simple data types—such as String and Array—and registered custom data types in an application-specified location in the file system that can be accessed across multiple sessions. Unlike browser cookies, a SharedObject has a larger file size limit of 100KB and is serialized by using the ActionScript Messaging Format (AMF). AMF is a binary file format used to serialize ActionScript objects and used in Flash remoting to pass remoting objects between the server and a client. With these tools in hand, you can begin to build applications that interact with data without the reliance of an online service to store and react to live session data.

17.1. Create ...

Get Flex 3 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.