Solved

Filter Bad Words using flash mx 2004

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Reduce the size of the Flash SWF file it executes 12 418
FLV versus SWF 11 277
Rotating Adobe pdf document 4 310
FlashBuilder allocate more memory using FlashBuilder.ini 18 264
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,…
In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.

776 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