the red5 code looked like this
in appStart
...
Boolean create = createSharedObject(scope, "my_so", true);
if(!create) throw new Error("Failed to create shared object.");
sharedObject = getSharedObject(scope, "my_so", true);
sharedObject.addSharedObjectListener(new AppSharedObjectListener());
messages.add("Welcome to the tests, be our guests");
sharedObject.beginUpdate();
sharedObject.setAttribute("messages", messages);
sharedObject.endUpdate();
...
I was assuming that by doing this their would be something in the shared object's data when a client would connect..
the shared object created in flash was done like this
so = SharedObject.getRemote("my_so", "rtmp://localhost/app");
So it's seemed, that each "first" time that the swf was launched (after compiling), when the onSync method was called, the so's data was 'cleared' ... the only thing that made changes to the so's data was done on the client side...
all i did was
so = SharedObject.getRemote("my_so", "rtmp://localhost/app", true, false);
and now as soon as i connect to the app, i can get the stuff that was expecting for.
I'm still not 100% sure of myself as usual, but this stuff seems to be working as expected
... now i'll try to stream some video :)
On 9/12/06, John Grden <[EMAIL PROTECTED]> wrote:
was it setting flex's net connection to work with amf0?
On 9/12/06, julien castelain < [EMAIL PROTECTED]> wrote:_______________________________________________problem solved
On 9/11/06, julien castelain <[EMAIL PROTECTED] > wrote: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 becauselog.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 methodsharedObject.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 codethanks in advance for the helpciao
Red5 mailing list
[email protected]
http://osflash.org/mailman/listinfo/red5_osflash.org
--
[ JPG ]
_______________________________________________
Red5 mailing list
[email protected]
http://osflash.org/mailman/listinfo/red5_osflash.org
_______________________________________________ Red5 mailing list [email protected] http://osflash.org/mailman/listinfo/red5_osflash.org
