Adobe Connect User Community
Menu

#1 2008-11-26 16:41:31

**_rprotsyk_**

How to set proper user name in Pod Application?

Hello,

Currently I am developing Pod application similar to Adobe Connect Chat. Do you know  how can I show which user had send the message? I have used syncConnector.userName property. But  during synchronization  I am receiving the name of  currently logged user in  the messages TextArea and not the name of user who sent the message. Do you know how  this functionality is realized in Adobe Connect Pro Chat?

Thanks,
Roman

Offline

#2 2008-11-28 12:05:19

alistairlee

Re: How to set proper user name in Pod Application?

Hey Roman,

It sounds like the syncConnector.userName code is getting executed locally on each individuals version of the application.  You're most likely using it in the "syncMessageReceived" function.

I'm asumming you are calling the command to sync (dispatchSyncMessage) every time someone submits a new chat message.  The dispatchSyncMessage method has two parameters:
messageName = a string indicating which message you are sending (i.e. "updateChatWindow")
messageValue = an object with a value (this could be almost anything - a string, number, array, object etc...)

I would create a simple array to carry the information about each chat message.

arrChatMessage[0]= syncConnector.userName;
arrChatMessage[1]= txtChat.text;

You can then pass the array as the message value to the syncConnector:

syncConnector.dispatchSyncMessage("updateChatWindow",arrChatMessage);

Now - your syncMessageReceived function will simply evaluate the array with two string values in it, instead of running the syncConnector.username locally.

Thanks,
Alistair

Offline

Board footer