You already know how to work with data that is stored in memory as long as a Flash movie is open. In fact, almost all data you work with in ActionScript is of this type. But what if you want to be able to store data between Flash movie sessions? Or what if you want to be able to share data between Flash movies running on the same client, or even on different clients? To accomplish these feats, we’ll need to look at how we can store and transmit data outside of the Flash Player.
This chapter addresses both client-side and server-side data. First,
we’ll examine client-side data. Prior to Flash 6,
the only way to store persistent data on the client was with complex
write cookies. However, Flash 6
shared objects to
ActionScript, making it possible to store and retrieve persistent
data on the client without the use of these other, complicated
We’ll also take a closer look at server-side data.
Prior to Flash 6, server-side data manipulation was limited to
invoking server-side scripts (using
) or an
XML object) to read and write
data to text files and/or databases on the server. The problem was,
of course, that this functionality required that you had the
necessary scripts on the server. While this kind of functionality
still has its place (although the
supercedes the older
loadVariables( ) method), this chapter ...