[Red5] Re : Re : Red5 events en SYNC

Dominick Accattato daccattato at gmail.com
Mon Jan 19 14:04:15 PST 2009


in other words, you wont see change events if the event is dispatched from
the same instance.  the change event only happens when another user changes
it.

On Mon, Jan 19, 2009 at 5:03 PM, Dominick Accattato <daccattato at gmail.com>wrote:

> if you use the login component and userlist component then you can open up
> two browser windows and login with different names.  Logging in from the
> second browser will send the change event.
>
>
> On Mon, Jan 19, 2009 at 9:12 AM, Etienne Bonnefoy <etiennebon at yahoo.fr>wrote:
>
>> Hello again,
>>
>> thank you for your answers again, Liang. You're quite good to find out
>> that I'm not English ;) (I'm french...).
>>
>> Anyway, I succeeded in solving my issue.
>> Here is the code I had before on the RemoteSharedObject Class:
>> *
>>
>> public
>> * *function* RemoteSharedObject( name:String, persistence:Boolean=*false*,
>> secure:Boolean=*false*, connection:Red5Connection=*null* )
>>
>> {
>>
>> _name = name;
>>
>> _persistence = persistence;
>>
>> _secure = secure;
>>
>> _conn = connection;
>>
>> *use* *namespace* raf;
>>
>> Red5ServiceLocator.getInstance().registerRemoteSharedObject(
>> *this* );
>>
>> *
>>
>> /* if( useDefaultConnection &&
>> Red5ServiceLocator.getInstance().getDefaultRed5Connection() != null )
>>
>> this.connect(Red5ServiceLocator.getInstance().getDefaultRed5Connection());
>> */
>> *
>>
>> *if*( _conn.connected ) {
>>
>> *this*.connect( _conn );
>>
>> }
>> *else* {
>>
>> _conn.addEventListener( Red5Event.CONNECTED,
>> *this*.netConnectedHandler );
>>
>> _conn.addEventListener( Red5Event.DISCONNECTED,
>> *this*.netDisconnectedHandler );
>>
>> }
>>
>> }
>>
>> I changed it to that:
>> *
>>
>> public
>> * *function* RemoteSharedObject( name:String, persistence:Boolean=*false*,
>> secure:Boolean=*false*, connection:Red5Connection=*null* )
>>
>> {
>>
>> _name = name;
>>
>> _persistence = persistence;
>>
>> _secure = secure;
>>
>> _conn = connection;
>>
>> *use* *namespace* raf;
>>
>> Red5ServiceLocator.getInstance().registerRemoteSharedObject(
>> *this* );
>>
>> *
>>
>> /* if( useDefaultConnection &&
>> Red5ServiceLocator.getInstance().getDefaultRed5Connection() != null )
>>
>> this.connect(Red5ServiceLocator.getInstance().getDefaultRed5Connection());
>> */
>> *
>>
>> *if*( _conn.connected ) {
>>
>> *this*.connect( _conn );
>>
>> _conn.addEventListener( Red5Event.CONNECTED,
>> *this*.netConnectedHandler );
>>
>> _conn.addEventListener( Red5Event.DISCONNECTED,
>> *this*.netDisconnectedHandler );
>>
>> }
>> *else* {
>>
>> _conn.addEventListener( Red5Event.CONNECTED,
>> *this*.netConnectedHandler );
>>
>> _conn.addEventListener( Red5Event.DISCONNECTED,
>> *this*.netDisconnectedHandler );
>>
>> }
>>
>> }
>>
>>
>>
>> I just added some **
>>
>> public
>> *function* RemoteSharedObject( name:String, persistence:Boolean=*false*,
>> secure:Boolean=*false*, connection:Red5Connection=*null* )
>>
>> {
>>
>> _name = name;
>>
>> _persistence = persistence;
>>
>> _secure = secure;
>>
>> _conn = connection;
>>
>> *use* *namespace* raf;
>>
>> Red5ServiceLocator.getInstance().registerRemoteSharedObject(
>> *this* );
>>
>> *
>>
>> /* if( useDefaultConnection &&
>> Red5ServiceLocator.getInstance().getDefaultRed5Connection() != null )
>>
>> this.connect(Red5ServiceLocator.getInstance().getDefaultRed5Connection());
>> */
>> *
>>
>> *if*( _conn.connected ) {
>>
>> *this*.connect( _conn );
>>
>> _conn.addEventListener( Red5Event.CONNECTED,
>> *this*.netConnectedHandler );
>>
>> _conn.addEventListener( Red5Event.DISCONNECTED,
>> *this*.netDisconnectedHandler );
>>
>> }
>> *else* {
>>
>> _conn.addEventListener( Red5Event.CONNECTED,
>> *this*.netConnectedHandler );
>>
>> _conn.addEventListener( Red5Event.DISCONNECTED,
>> *this*.netDisconnectedHandler );
>>
>> }
>>
>> }
>>
>> I only added some Red5EventListener for Connection, in the
>> RemoteSharedObject.
>>
>> Before that, when constructing the RemoteSharedObject, the "this.connect"
>> function was cald but never after...
>> So, with the EventListeners, this function is called at every
>> connection... So I can retrieve the old Client I had, but with a new UID.
>>
>> I'm happy for today, he he.
>>
>> Hope I can help someone with anything now!!!
>>
>> Etienne.
>>
>>
>>
>>  ------------------------------
>> *De :* liang bowen <liangbowen at gmail.com>
>> *À :* red5 at osflash.org
>> *Envoyé le :* Lundi, 19 Janvier 2009, 13h05mn 32s
>> *Objet :* Re: [Red5] Re : Red5 events en SYNC
>>
>> i am not quite understand what you were saying,  it seems you are not from
>> an english speaking country, me neither.
>>
>> if you want to keep you sharedobject content unchanged after disconnted,
>> you may create a  persistent sharedobject, instead of a non-persistent
>> sharedobject.
>> as uid, you can retrieve it from a successful netconnection callback, from
>> sharedobject sync event is not necessary.
>>
>>
>>
>> 2009/1/19 Etienne Bonnefoy <etiennebon at yahoo.fr>
>>
>>>  Hello,
>>>
>>> thanks for your answer.
>>> As far as I understood, I need to have some changes in my SharedObject in
>>> my second connection (I have: creation with connection then disconnection
>>> and then new connection with nothing happening...) in order to have the
>>> display of a Sync Event.
>>>
>>> Unfortunately, I only disconnect and reconnect, without changing my
>>> username or so on...
>>>
>>> How could I update the SharedObject without changing anything?
>>>
>>> Actually, I can see, on the server Side, that the UID of my client is
>>> incremented every time I reconnect. But I am not able to retrieve this UID,
>>> because the function: RemoteSharedObject (event.target) needs a SyncEvent to
>>> be called...
>>> So I'm facing a circle...: I need the Shared Object to get and update the
>>> UID of the client, but I need to Update the UID of the Client to retrieve an
>>> Event in order to riech the RemoteSharedObject...
>>>
>>> I unfortunately don't find the explaination in the Flash Help guide.
>>>
>>> Anyway, thanks for helping.
>>>
>>> Etienne.
>>>
>>>
>>>  ------------------------------
>>> *De :* liang bowen <liangbowen at gmail.com>
>>> *À :* red5 at osflash.org
>>> *Envoyé le :* Lundi, 19 Janvier 2009, 11h36mn 19s
>>> *Objet :* Re: [Red5] Red5 events en SYNC
>>>
>>> you should really read the flash as help document first.  read the
>>> sharedobject and syncevent section.
>>> 2009/1/19 Etienne Bonnefoy <etiennebon at yahoo.fr>
>>>
>>>>  Hello,
>>>>
>>>>
>>>>
>>>> I'm using Dominick Jedai Application and I'm facing the following issue:
>>>>
>>>> For any users, I can connect, Tchat, use the Video BroadCasting...
>>>>
>>>> If I follow the code, I can figure out that there are some "SyncEvent"
>>>> that are displayed when connecting for the first time to the server.
>>>>
>>>> Especially, there is a SYNC event with a "ChangeList" with the 2 codes:
>>>> "clear" and "change" for the userList.
>>>>
>>>>
>>>>
>>>> I created a "Disconnect" Button. I can use it and disconnect from the
>>>> server.
>>>>
>>>>
>>>>
>>>> But when I try to reconnect, I observe that there is a "SynchEvent" for
>>>> the userList that is displayed. Unfortunately, the "changeList" of this
>>>> SyncEvent is only composed of the "clear" Code and not the "Change" code.
>>>>
>>>>
>>>>
>>>> I would like to anderstand why, actually, if anybody can enlight me on
>>>> this.
>>>>
>>>>
>>>>
>>>> I would like also to know, Where and When this SyncEvent is created or
>>>> displayed (what action created it??).
>>>>
>>>>
>>>>
>>>> Finally, I'm running my Jedai application on my lap-Top with Windows XP.
>>>> I am not able to run the log (I don't know how to set the logs to ON, on the
>>>> server side...Event if I start the application under the Debug-Mode, I don't
>>>> have any action displayed...). I'm not able neither to find where my shared
>>>> Object is stored on my computer (I would like to read it, in order to see if
>>>> it has been updated or not...).
>>>>
>>>> I anyone can help me on this, it would be wonderful.
>>>> I'm totally open to discuss on my code if necessary to anderstand my
>>>> issue.
>>>>
>>>> Thanks,
>>>>
>>>>
>>>>
>>>> Etienne.
>>>>
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> Red5 mailing list
>>>> Red5 at osflash.org
>>>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>>>
>>>>
>>>
>>>
>>> --
>>> liangbowen
>>>
>>>
>>> _______________________________________________
>>> Red5 mailing list
>>> Red5 at osflash.org
>>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>>
>>>
>>
>>
>> --
>> liangbowen
>>
>>
>> _______________________________________________
>> Red5 mailing list
>> Red5 at osflash.org
>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>
>>
>
>
> --
> Dominick Accattato, CTO
> Infrared5 Inc.
> www.infrared5.com
>



-- 
Dominick Accattato, CTO
Infrared5 Inc.
www.infrared5.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://osflash.org/pipermail/red5_osflash.org/attachments/20090119/f8074e20/attachment-0001.html>


More information about the Red5 mailing list