Solved

Filter Bad Words using flash mx 2004

Posted on 2004-08-19
4
542 Views
Last Modified: 2008-01-09
Hello, I'm creating a guestbook using flash with ASP. How can I filter bad words using Flash actionscripts. I dont have any idea how to do it in Flash MX 2004. The user will add a comment to a dynamic text with a variable "mess". What function will I use and how will I use it. thanx in advance.
0
Comment
Question by:bawasi
  • 2
4 Comments
 
LVL 1

Assisted Solution

by:cparcell
cparcell earned 150 total points
ID: 11840984
basically you want to create a list of "bad" words.

badWords = new Array();
badWords = ["xyz", "abc", "mno"];

Now you just check against the list you made.

userText = mess;
found = new Array();

for(n=0; n < badWords.length -1; n++){
    if(userText.indexOf(badWords[n]) != -1){
        found.push(userText.indexOf(badWords[n]));
    }
}

This will give you a list of the possition of all the bad words in the string.

Charles P.
0
 

Author Comment

by:bawasi
ID: 11849163
Thanks, but can I make it not case sensitive, because for example I made "xyz" as a badword, it will not consider "xYz" as a badword. And another thing is that, I made "ass" as a badword, he will already consider "assessment" as bad word.
0
 
LVL 39

Accepted Solution

by:
blue-genie earned 100 total points
ID: 11850280
in terms of the case sensitive bit, you can just convert everything they type to lower case, and make sure all the words are lower case in the list. In terms of the ass and assessment bit, that's a tougher one.

if it was always the case that a character followed the "bad word" - you could simply check that there's no preceding character or character before it.
0
 

Author Comment

by:bawasi
ID: 11850773
Thanks. Thats a great suggestion for the case sensitive. But for the ass-assessment. I think I'm going to work on it some other time. thanks again.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now