
Chapter 114
Understanding shared objects
Shared objects are a means for sharing data among different clients, among different instances of
an application running on the Flash Communication Server, and across applications running on
multiple Flash Communication Servers. The Flash Communication Server supports three types
of shared objects—local, remote, and server-side. These objects are discussed briefly below. For
more information on working with shared objects, see “SharedObject object” on page 80.
Local shared objects
One way to use shared objects is for local storage and retrieval of data. Data is stored on the end-
user’s computer and may be accessed at different times by one or more Flash applications. Local
shared objects can also be non-persistent—that is, available only while the application is running.
Local shared objects don’t require a connection to the Flash Communication Server, and are not
discussed in detail in this manual. For information about where persistent local shared object data
is stored, see “Shared object files” on page 68. For more information about local shared objects,
see the
SharedObject.getLocal entry in the Client-Side Communication ActionScript
Dictionary.
Remote shared objects
In client-side ActionScript, you can create and reference shared objects that are available to other
Flash Communication Server application instances running on the same or different clients. Like
local shared objects, these objects can persist on the local computer. However, they can also persist
on the server, so that any user who connects to the shared object has access to the same
information.
For example, you can open a remote shared object, such as a phone list, that is persistent on the
server. Whenever a client makes any changes to the shared object, the revised data is available to
all clients that are currently connected to the object or who later connect to it. If the object is also
persistent locally and a client changes the data while not connected to the server, the changes are
synchronized with the remote shared object the next time the client connects to the object.
Of all the types of shared objects, you will probably use remote shared objects most often in your
Flash Communication Server applications. Several of the samples in this manual use shared
objects for such tasks as sharing text (see “Sample 2: Shared Text” on page 35) and letting
multiple clients manipulate an object on the Stage at the same time (see “Sample 3: Shared Ball”
on page 37). For information about where persistent remote shared object data is stored, see
“Shared object files” on page 68. For more information about remote shared objects, see the
SharedObject.getRemote entry in the Client-Side Communication ActionScript Dictionary.
Server-side shared objects
As shown earlier (see “Client-server object communications” on page 13), you can use server-side
shared objects to communicate with client-side shared objects. In applications that implement
connectivity among multiple Flash Communication Servers, you can also use server-side shared
objects to share data between the servers. For more information about server-side shared objects,
see the
SharedObject.get entry in the Server-Side Communication ActionScript Dictionary.
Applications and application instances
This section discusses where you must place application data that you want the server to find, and
also explains how and why to run application instances.
Commenti su questo manuale