Macromedia flash media server 2-client-side actionscript language reference for flash media server 2 User Manual
SharedObject class
113
The following examples show a few ways shared objects are called within ActionScript
programs. Notice that in order to create a remote shared object, you must first connect to
Flash Media Server with the RTMP protocol.
programs. Notice that in order to create a remote shared object, you must first connect to
Flash Media Server with the RTMP protocol.
// Create a local shared object.
var local_so:SharedObject = SharedObject.getLocal("foo");
var local_so:SharedObject = SharedObject.getLocal("foo");
// Create a remote shared object that is not persistent on the server.
var my_nc:NetConnection = new NetConnection();
my_nc.connect("rtmp://server.domain.com/chat/room3");
var remote_so:SharedObject = SharedObject.getRemote("users", my_nc.uri);
remote_so.connect(my_nc);
var my_nc:NetConnection = new NetConnection();
my_nc.connect("rtmp://server.domain.com/chat/room3");
var remote_so:SharedObject = SharedObject.getRemote("users", my_nc.uri);
remote_so.connect(my_nc);
/* Create a remote shared object that is persistent on the server
but not on the client. */
var my_nc:NetConnection = new NetConnection();
my_nc.connect("rtmp://server.domain.com/chat/room3");
var remote_so:SharedObject = SharedObject.getRemote("users", my_nc.uri,
but not on the client. */
var my_nc:NetConnection = new NetConnection();
my_nc.connect("rtmp://server.domain.com/chat/room3");
var remote_so:SharedObject = SharedObject.getRemote("users", my_nc.uri,
true);
remote_so.connect(my_nc);
/* Create a remote shared object that is persistent on the server
and on the client. */
var my_nc:NetConnection = new NetConnection();
my_nc.connect("rtmp://server.domain.com/chat/room3");
var remote_so:SharedObject = SharedObject.getRemote
and on the client. */
var my_nc:NetConnection = new NetConnection();
my_nc.connect("rtmp://server.domain.com/chat/room3");
var remote_so:SharedObject = SharedObject.getRemote
("users", my_nc.uri, "/chat");
remote_so.connect(my_nc);
Designing remote shared objects
When designing remote shared objects, develop a model for how the data will be managed.
Take into account issues of data design and management, conflict resolution, and storage
(persistence) requirements, both locally and on the server. These issues are discussed briefly in
this section.
Take into account issues of data design and management, conflict resolution, and storage
(persistence) requirements, both locally and on the server. These issues are discussed briefly in
this section.
When using a locally persistent remote shared object, make sure your Stage size is at least
215 by 138 pixels. Flash Player needs at least this much space to display the Settings panels
and various dialog boxes.
215 by 138 pixels. Flash Player needs at least this much space to display the Settings panels
and various dialog boxes.