Expand my Community achievements bar.

SimpleChatModel not returning userName

Avatar

Former Community Member

Hi,

I'm building a sample application using LCCS, one of the components that I'm using is the SimpleChatModel and I think I've found a bug.

The example uses AS3 only, and users access the chat room using Guest access.

Each of the functions below should be self-explanatory, onMessageReceived is for receiving ChatEvents and sendMessage is for sending the user input.

I've noticed that the event.message.userName is returning as "Null", despite being added in the ChatMessageDescriptor.  It appears to be a bug, but for now I am using the msg property to bundle the userName.

thanks,

Mark

private function onMessageReceived(event:ChatEvent):void
        {
            list.dataProvider.addItem(event.message.userName);
            list.scrollIndexVisible(list.dataProvider.length, 1);
        }
       
        private function sendMessage(event:MouseEvent):void
        {
            var msg:ChatMessageDescriptor = new ChatMessageDescriptor;
            msg.displayName = chatRoom.userName.toString();
            msg.msg = chatRoom.userName+": "+textEntryComp.messageEntry.input.text;
            chatRoom.sendMessage(msg);
        }

1 Reply

Avatar

Former Community Member

Hi Mark,

At first glance, I don't see an issue with SimpleChat (I made a combo of our LoginDialog & SimpleChat sample apps - and it worked fine).

However since you sent me your code privately, I will scan through it quickly to see if i can make my app look more like yours.

I will keep you posted.

Thanks for the report,

Julien

LCCS Quality Engineering