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.
// Create a local shared object.
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);
/* 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,
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
("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.
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.
Содержание FLASH MEDIA SERVER 2-CLIENT-SIDE ACTIONSCRIPT LANGUAGE REFERENCE FOR FLASH MEDIA SERVER...
Страница 1: ...Client Side ActionScript Language Reference for Flash Media Server 2...
Страница 4: ...4 Contents...
Страница 148: ...148 Client Side ActionScript Language Reference...