Using Communication Objects > Flash Communication Server objects > Understanding shared objects |
![]() ![]() ![]() |
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 objectslocal, remote, and server-side. These objects are discussed briefly below. For more information on working with shared objects, see Shared object files.
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-persistentthat 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. For more information about local shared objects, see the SharedObject.getLocal
entry in the Client-Side Communication ActionScript Dictionary.
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 tutorials installed with Flash Communication Server use shared objects for such tasks as sharing text (see the Shared Text FLA file) and letting multiple clients manipulate an element, such as a graphic element, on the Stage at the same time (see the Shared Ball FLA file). For information about where persistent remote shared object data is stored, see Shared object files. For more information about remote shared objects, see the SharedObject.getRemote
entry in the Client-Side Communication ActionScript Dictionary.
A proxied shared object is a remote shared object that, instead of being shared between a client and server application, is shared between two different Flash Communication Server applications, or between instances of the same application. For example, consider two instances of the same chat application, /chat_01
and /chat_02
. On the server, the /chat_01
application instance could connect to a shared object defined in /chat_02
and then use the information in that shared object as if it were defined in /chat_01
.
For more information about proxied shared objects, see the SharedObject.get
entry in the Server-Side Communication ActionScript Dictionary.
![]() ![]() ![]() |