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.

Revisions

  1. theturtle32 created this gist Mar 3, 2012.
    22 changes: 22 additions & 0 deletions gistfile1.as
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    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, '****');
    }
    }
    }