Board Thread:Support Requests - Getting Technical/@comment-3444778-20130117221452/@comment-1997905-20130205211300

You have to bind the function as a listener. You could have something like this: function aListener(chat) { //do stuff } mainRoom.model.chats.bind('afteradd', aListener);

Every time a message is added to the window, your function will be called. It's given one argument,, which is an object that has everything you would ever want to know about the message, and several dozen things you don't. The message text is  , and you can refer to it that way instead of having to store it in a variable (unless you need to change it).