Chapter 8. Shared Objects
Remote shared objects are used in FlashCom
applications to do everything from sharing the position of spaceships
in a game to broadcasting chat text messages. They are a good way to
keep track of what users are doing in a conference, let movies know
what streams are available, and allow users to disconnect and
reconnect to an application without losing track of the
application's state.
Shared
objects are an extension of ActionScript objects that allow objects
to be shared by more than one movie and to be stored for later use.
Local shared objects
(LSOs) can be stored and retrieved locally by Flash movies between
sessions and, under some circumstances, by more than one movie.
Remote shared
objects (RSOs) can be shared in real time by Flash movies connected
to the FlashCom Server. When one movie changes a property of its copy
of an RSO, updates are sent automatically to all the other movies
sharing the same object. RSOs can be stored locally and on the
FlashCom Server. RSOs have a send( ) method
similar to NetStream objects that can be used to
broadcast messages to every movie connected to a shared object.
|