A RSO lives at least on one client and is always known to the server. Typically, you have the RSO not just on one client but on many. These distributed RSO can be used for two things:
- Synchronize data of any type automatically
- Send a message to all shared objects
How-to on the client
- Create RSO: var so:SharedObject = SharedObject.getRemote(“nameOfRSO”, netConnection.uri, false)
- Create or update a property: sharedObject.setProperty(“propertyName”, propertyValue)
- With non-primitive types of propertyValue, use sharedObject.setDirty()
- Send a message: sharedObject.send(“methodName”, arguments)
- Like a local shared object, you could store the data of a RSO permanently on the client side (=persistence). This brings with it that the size of the RSO has to comply to the global storage setting on each client.
How-to on the red5-side
- First of all, see the tutorial of Joachim Bauch
- Create RSO in a given scope: createSharedObject(scope, “nameOfRSO“, false);
- Create or update a property: sharedObject.setAttribute(“propertyName”, propertyValue);
- If you update several properties at once, use sharedObject.beginUpdate(); / endUpdate()
- What about type conversion? ActionScript -> Java, Java -> ActionScript.
- Note that you can use [RemoteClass(alias="com.faindu.sample.className")].
18 July 2007 at 7:30 |
[...] See previous entry. [...]
14 December 2007 at 7:29 |
Shore but useful information on Remote Shared Object.
27 December 2007 at 11:50 |
Hi,
we are working on Flex3 (with Cairngorm Microarchitecture) with Red5 to develop a RIA.
I am trying to store a custom-class-object as a property of SharedObject, it is not working properly. This is storing and broadcasting the number and string variables inside that custom-class-object. But if there is any object inside that custom-class-object, in such a case, this is not storing and broadcasting the proper value.
Can u help me?
thanks
sumant