Solved

Filter Bad Words using flash mx 2004

Posted on 2004-08-19
4
556 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
free flash maker 5 222
Rotating Adobe pdf document 4 338
Flash Converter 8 142
Actionscript in Flash 3 105
Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
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…
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

734 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