Solved

Filter Bad Words using flash mx 2004

Posted on 2004-08-19
4
558 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

631 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