Flash Communication Server architecture overview > About streams and shared objects |
![]() ![]() ![]() |
About streams and shared objects
In traditional client-server applications, the server is typically used to execute some kind of transaction; the client makes a request, the server performs a database lookup or some resource-based calculation, and then returns a result to the client. The connection between the client and server is maintained only long enough to complete the transaction.
While you can use the Flash Communication Server to implement transactions, its core use is handling interactionscoordinating the actions of multiple, connected users, or clients, and transmitting server-side data. Flash Communication Server provides two communication models that simplify the process of handling user interactions: streams and shared objects.
Streams are a time-based flow of synchronized audio, video, and/or data messages that flow from client to server, or from server to client. Streams use a publish and subscribe model that simplifies development of applications that use streams. For a example of publishing and playing a video stream see Publishing and playing a stream.
A published stream can be played in real time (a video chat application, for example), or recorded and played later.
Recorded streams are saved in the Flash Video (FLV) format. (Note that recorded streams can contain data messages, as well as video). You can also create FLV files from existing digital video or audio files using third-party video encoding utilities, like Sorenson Squeeze, or export them from Flash MX. In this way you can stream pre-recorded content using Flash Communication Server.
Live stream
Playback of a stream recorded as a FlashVideo (FLV) file
There are two basic types of shared objects you can use when creating communication applications: local and remote. Local shared objects can be thought of as "Flash cookies": they let you save data to a user's computer for off-line access, or for saving preferences. Local shared objects are a feature of Flash Player and do not require Flash Communication Server.
Remote shared objects are managed by Flash Communication Server and provide messaging, data synchronization, and data storage services. Flash clients connect, or subscribe, to a remote shared object and receive updates whenever a change is made to that shared object. Also, messages can be sent to all clients connected to a remote shared object. A remote shared object can persist across application sessions, or be temporary.
Shared objects provide data storage and synchronization services for clients.
For more information on how shared objects work see Shared object flow and SharedObject object. For an example of using shared objects see the Shared Ball sample on the Welcome page in Flash Communication Server.
Connecting to external data sources
In addition to the communication models provided by streams and shared objects, Flash Communication Server can also interact with external data sources such as web services and relational databases, or even other Flash Communication Server applications. For example, you might write server-side ActionScript to connect to a web service or ColdFusion application to retrieve a list of names and phone numbers. The results of the query could then be placed into into a shared object.
The Flash Communication Server can interact with external data sources.
For more information on connecting to external data sources see Application Server Connectivity.
![]() ![]() ![]() |