Hi,

I wrote my version about this 2 days ago. 
Mail called [Red5] SO.sendMessage, SO.send + FLEX2.

Also it makes problem to me. I dont know why.

We just need to know how to make SEND method work. (better in AS 3.0)

Pleeeasse.

Thanks

Tom


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Manolo R.G.
Sent: Friday, September 29, 2006 4:53 PM
To: [email protected]
Subject: Re: [Red5] Shared Object Event Handler

Daniela Remogna escribió:
> 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 ) {
>   
This don't answer your question but you can manage users online list 
client side if you add and remove attributes (clientId, username) to 
so_users server side.
When a user connects to a SharedObject, red5 ;-)           is passing 
all SharedObject attributes to flash on his own with the 
info[index].code = 'change'.
It uses less data transfer than sending the whole userlist to all the 
clients every time a new one joins app. It's working for me at least:

so_users_so.onSync = function(info) {
        for (var i in info) {
                var user_name = so_users.data[info[i].name];
                var client_id = info[i].name ;
                var notified_event = info[i].code;
                switch (notified_event) {
                        case 'change':
                                trace(user_name + " : " + client_id + " 
: " + notified_event);
                                //  add client to your component;
                                break;
                        case 'delete':
                                 // remove client for your component
                                 ...

User a joins app, trace says:
a : 7 : change

User b joins app, trace says:
b : 8 : change
a : 7 : change

User a leaves app, b client trace says:
a : 7 : delete



_______________________________________________
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

Reply via email to