Skip to content

Instantly share code, notes, and snippets.

@theturtle32
Created March 3, 2012 00:05
Show Gist options
  • Save theturtle32/1962680 to your computer and use it in GitHub Desktop.
Save theturtle32/1962680 to your computer and use it in GitHub Desktop.
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