Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
package
{
import com.worlize.api.WorlizeAPI;
import com.worlize.api.event.ChatEvent;
import flash.display.Sprite;
public class EmbedClientTest extends Sprite
{
private var api:WorlizeAPI;
public function EmbedClientTest() {
WorlizeAPI.init(loaderInfo);
api = WorlizeAPI.getInstance();
api.thisRoom.addEventListener(ChatEvent.OUTGOING_CHAT, filterLanguage);
}
private function filterLanguage(event:ChatEvent):void {
event.text = event.text.replace(/(fuck|shit|cunt|damn)/gi, '****');
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment