hi list,
 
 
I've been trying to figure out how "remote" SharedObjects work with red5 and flex.
I've never worked with FCS or FMS before so maybe i'm not doing things the right way here. However, i' read the red5 docs and the flex docs so on the server side here is how i create the shared object (in the appStart method)
 
    Boolean create = createSharedObject(scope, "my_so");
    if(!create) throw new Error("Failed to create shared object.");
   
    sharedObject = getSharedObject(scope, "my_so");
 
i think that's ok because
    log.debug("shared object : " + sharedObject);  displays "shared object : SharedObject : my_so"
 
but maybe i'm wrong ...
then i tried setting some properties in the shared object in the appConnect method
 
    sharedObject.beginUpdate();
    sharedObject.setAttribute("messages", new String[] {"a", "b"}); 
    sharedObject.endUpdate();
 
when i lauch the red5 server everything seems to be ok, at least there aren't any errors,
as for the client side, this is the way i create my sharedObject :
 
   sharedObject = SharedObject.getRemote("videobook_so", "rtmp://localhost/MyApp");
   sharedObject.addEventListener(FCStatusEvent.CONNECTED, onConnected);
   sharedObject.addEventListener( SyncEvent.SYNC, onSync);
   sharedObject.connect(MyNetConnection);
 
i think that's right too because the onSync method gets called, but it seems that their is no "data" or "properties" in the shared object.
the weird thing is that if i try this on the client side:
 
  sharedObject.setProperty("messages", ["yo", "man", "this", "should work"]);
 
the onSync method gets called once again and this time tells me that the "messages" property of the shared object exist.
 
Maybe this isn't the place to ask such questions, but -
1 - am i doing something wrong?
2 - can we create the shared object on the server side with "data" in it like i tried to?
3 - is there a simple example somewhere? i looked in the samples but i only see AS2 code
 
thanks in advance for the help
 
ciao
 
 
   
_______________________________________________
Red5 mailing list
[email protected]
http://osflash.org/mailman/listinfo/red5_osflash.org

Reply via email to