Hi!
I'm a newbie of Java....
I've tryed to implement the "remote_so.send(handler,args)" FCS method on Red5
but without success....
I've read the migration guide, I've understood that I've to register an Event
Handler but I don't understand two thinks:
1) how can I call the method from server side?
2) how can I pass it the parameters?
On client side code I've defined a shared object method called "msgFromSrv",
below there is the code.
Now, when a new client is connected to my S.O. I want to call this method from
server side.
Client Side:
users_so = SharedObject.getRemote("usersList",nc.uri,false);
users_so.onSync = function(info){
_root.people.removeAll();
for ( var i in users_so.data ) {
if ( users_so.data[i] != null ) {
_root.people.addItem(users_so.data[i]);
}
}
}
users_so.connect(nc);
users_so.msgFromSrv = function(msg) {
history_txt.text = msg;
}
}
on server side, I've created the class MySharedObjectHandler with this code:
class MySharedObjectHandler{
public void msgFromServer(String history){
}
}
And on Application Java I wrote:
public boolean connect(IConnection conn, IScope room, Object param[]){
user_name=(String)params[0];
so = getSharedObject(Red5.getConnectionLocal().getScope(),"usersSO",true);
so.addSharedObjectListener(new SampleSharedObjectListener());
//***************************
so.registerServiceHandler("msgFromServer", new MySharedObjectHandler());
// How Can I pass the string history???
//***************************
so.beginUpdate();
so.setAttribute(user_name,Red5.getConnectionLocal().getClient().getId());
return true;
}
}
Now, I connected to my application, but the method msgFromServer doesn't
runs..... why? :(
Thanks for help....
Daniela Remogna
_______________________________________________
Red5 mailing list
[email protected]
http://osflash.org/mailman/listinfo/red5_osflash.org