Kongregate Developers


You may use the standard addEventListener function to listen for various events broadcast by the chat API.

The tab_visible event is broadcast when a showTab request is completed and the custom tab is created:

function onTabShown(event:Event){
  trace("Tab shown!");

The message event is broadcast when the player inputs something into the chat window and presses return. The event contains a data field which you can use to get at the text that was entered:

function onPlayerMessage(event:*){
  trace("Message: " + event.data.text);