ActionScript 2.0 :: Profanity Filter - It Fails When The User Enters Only A Single Word?

Jul 13, 2010

First of all, props to Informatik at Actionscript.org for the following code. This is a profanity filter that will perform an action when it detects a word from an array. The problem is, it fails when the user enters only a single word:

Code:
var filteredWords:Array = new Array("apple", "grape", "orange", "watermelon");
submitBtn.onPress = function():Void{
if(checkFilteredWords(inputText.text) == true)[code].....

The code uses split(" ") to detect a space which is obviously causing the problem of failing to detect one word offenders. But without this, the filter would detect profanity in a word like "assets".

View 13 Replies


Similar Posts:


AS2 :: Create A Profanity Filter For An Application?

Jul 9, 2010

Trying to create a profanity filter for an AS2 application. Working with code found on this site on another post that doesn't seem to work. Anyone see the issue here?

test.onPress=function (){
badWords = ["this", "wont", "work"];
var lc_content = formContent.toLowerCase();
for (j=0; j<badWords.length; j++){

[Code].....

The form field is called "formContent". This returns both traces no matter the input so it must be a problem with the structure but I can't see it.

View 3 Replies

Flex :: Set Focus On One Component Until User Enters Some Value

Oct 3, 2011

I am trying to write the code for making a text input control in flex. As the user enters the value in text input control and then if he removes the typed characters to make the text input blank, then I print error message via StringValidator. But I want the focus to be set on that text input only until the user enters anything. How can I achieve that?

View 2 Replies

ActionScript 2.0 :: Go To Next Text Field / When User Enters A Letter

Sep 29, 2009

how can you go to the next text field when user enters a letter.I've created an array that saves the text box selected by the user.The crossword boxs are named from b1 to b59 and within these MC there the a textfield that named - textfld.[code]

View 1 Replies

ActionScript 3.0 :: How To Execute Function When User Enters Text

Jul 30, 2009

I have an input text box with the instance name of input_txt and a dynamic text field named output_txt. I'm trying to do something with the dynamic field when the user has entered text into the input field. So far, this is what I have:
input_txt.addEventListener(TextEvent.TEXT_INPUT, update);
function update(event:TextEvent):void {
output_txt.text = "foobar";
}
I don't know if this is valid ActionScript 3.0. I am getting an error that says "the class 'TextEvent' could not be loaded."

View 4 Replies

Flex :: Bind The Combobox Text The User Enters?

Aug 15, 2010

I have an editable combobox. How can I bind the text the user enters? I can only do binding when the user selects whatever it is they typed in...how can I bind it as they type?

View 1 Replies

ActionScript 3.0 :: Make A App Where The User Enters A Decimal Number?

Jul 3, 2009

I am rather new to actionscript and having some trouble. My goal is to make a app where the user enters a decimal number and the number of decimal places and the output is displayed in a dynamic text box. Here's what I have so far:

ActionScript Code:
go_btn.addEventListener(MouseEvent.CLICK,Display);
function round(num:Number, dp:int):Number {
var decimal:Number = Math.pow(10, dp);
trace(Math.round(decimals * num) / decimal)

[Code]...

View 1 Replies

ActionScript 3.0 :: User Enters Text Backwards For Math ?

Dec 29, 2009

I am working on a simple math game for kids. It is nearly complete but the problem I have is that when the user enters their answer in the input textfield, the numbers are entered from left to right. Most people do math problems from right to left. Is there a way to make the numbers appear from right to left? I am thinking that I would have to use an eventlistener on the number keys and also use parse text or arrays somehow to manipulate the numbers.

View 4 Replies

ActionScript 3.0 :: Multiply What A User Enters By Certain Number / When Button Is Pressed?

Aug 13, 2009

I am having a hard time finding a basic math tutorial. I am new to AS3 and just need to figure out how to multiply what a user enters by a certain number when a button is pressed.

View 1 Replies

ActionScript 1/2 :: User Enters And Exits One Movieclip Button Changes Color?

Jun 11, 2009

I currently have a slideshow-style navigation site.  There are five buttons on the bottom and when the user clicks each button, it triggers a nested movieclip to play.  I would like the button to be highlighted when the corresponding movieclip is playing, but when they click another button and another movieclip plays, I want the button to go back to its original color.
 
The problem is that the movieclips that are playing are nested two levels down and the buttons have to be on the main timeline.  I think I might need an event listener to see if a certain nested movieclip is playing, to know to change the button color.  It seems to easy but I can't figure it out,

View 5 Replies

ActionScript 2.0 :: Some Action When User Enters Something In The Input Field And Hit ENTER?

Nov 17, 2008

For an input field - i need to have some action when user enters something in the input field and hit ENTER.I am using this: but with this user can hit enter anywhere on the screen and get the action- i need to have it only when user selects the input field.

Code:
myNewObject = new Object();
myNewObject.onKeyDown = function() {[code]...

View 1 Replies

ActionScript 3.0 :: Correction - User Enters The Text The System Should Accept It As Correct?

Mar 1, 2012

I currently have an input text field where the user can enter their text.The text to be entered say is Adobe. First letter is Caps and rest small.In whatever probability the user enters the text the system should accept it as correct. For example: Adobe, adobe, adobE, ADOBE etc etc

View 4 Replies

ActionScript 2.0 :: Get Flash To Find The Difference (in Days) Between Two Dates That The User Enters?

Sep 3, 2006

how can I get Flash to find the difference (in days) between two dates that the user enters? For example if I have six input text boxes and I call them:

day1
month1
year1
day2
month2
year2

respectively, how can I get a dynamic text box called, say, "output" to find the difference between two dates that the user enters into the six text boxes, e.g.

day1 - The user enters 03
month1 - The user enters 09
year 1 - The user enters 2006
day2 - The user enters 25
month2 - The user enters 12
year2 - The user enters 2006

How do I get Flash to find the difference between today and Christmas?

View 1 Replies

ActionScript 2.0 :: Make Object(moon) Disappear After User Enters His Details?

Feb 24, 2011

a) A full moon is there on the screen in which Name and Password field is there.
b)The movement the user types his name and password and after pressing enter the moon should fade for some other animation.

Is action script needed for this?.

Am just a sort of general flash animator I don't know how to do things differently.

The animation further should continue where a steel door should open, two velvet ropes should be pulled aside which will make the bookcase wall swivels around to reveal the next animation

how to achieve point a and b.I will try pondering the rest on opening the steel door and pulling the velvet ropes that swivels the bookcase and goes to reveal another animation....

View 1 Replies

ActionScript 2.0 :: Controlling Sound - Music Automatically Start When The User Enters The Frame

Sep 15, 2011

So I am a complete novice at actionscript as was evident in my attempts to figure this out on my own. I have the following code to control the "Songs" section of my website and I would like the following features:

1. Not have the music automatically start when the user enters the frame. (I thought this was due to line 3 code but it still played after I deleted that code)

2. Add a "Back" button to go back 1 song.I currently have it set up with the following code on my "Songs" Page:

[Code]....

View 3 Replies

Visited Links In Flash - Resets Back To Enable Each Time A User Re-enters The Frame

Aug 26, 2011

I have a project in Flash Mx 2004. On the first frame there is a menu with 4 menu items. When the user clicks an item, they are taken to another frame with some text and an exit button that takes them back to the menu. The forward button will not become active until all of the menu items have been viewed. There is no particular order for the items to be viewed, just that they all be viewed before the forward arrow is active and the user can continue. I tried puttin an action on the exit button to disable the related menu item, however, the item just resets back to enabled each time a user re-enters the frame.

View 1 Replies

ActionScript 3.0 :: Replacing Single Character Of Word

Sep 28, 2009

I got a as3 question, I need to make a word guess game and got a small problem

Code:
Select all
for (var i:uint = 0; i < selectedWord.length; i++){
questionWord += "_";
} trace(questionWord);
trace(questionWord.replace(questionWord.charAt(0), selectedWord.charAt(0)));
trace(questionWord.charAt(0));

I want to replace a single character bij that of a character of word that you need to guess. But for some reason it doesn't work.

View 6 Replies

ActionScript 3.0 :: Add A Glow Filter To A Single MovieClip

Sep 8, 2009

I'm trying to add a glow filter to a single MovieClip out of a few I've got on my stage. This is what I've got so far but for some reason it applies the filter to absolutely every layer on stage, instead of just the one MC I want..

[Code]...

Come to think of it, all I'd really need would be a stroke, rather than a glow; but I don't know of any "stroke filter".. If the big picture would help at all, what I'm trying to do is "add" borders to a few (intersecting and growing) disk layer masks.. I'd like the stroke intersection to look like the "Liquid Form" found here: [URL]

View 1 Replies

ActionScript 2.0 :: Create A Tooltip For A Single Word Of Dynamic Text?

Feb 10, 2011

I need to create a tooltip for a single word of dynamic text, and I was wondering how to do it in AS 2.0. Also, it would be nice to have a clickable link in the tooltip, if possible.

View 9 Replies

ActionScript 3.0 :: Finding A Translation API For Flash That Can Return Multiple Translations/definitions For A Single Word?

Dec 20, 2010

translation API for Flash that can return multiple translations/definitions for a single word.

e.g.
fantasy = fantaisie, fantasme, imagination, cration
etc.

I've managed to find a few that do one word conversion. Including APIs that use Google Translate as a backend. But can't seem to get them to work so that they return alternative translations if available. The web-based PHP/JS/etc. APIs seem to offer this, but haven't found it in Actionscript yet.

View 0 Replies

Actionscript 3 :: Filter Out Random People From The Active User

Sep 21, 2011

I am designing a game that will be at a tradeshow which means lots of people walking by. The problem it seems is that once kinect sees you "New user" even if you are just strolling by it seems to kill or mess up the ONISkeletonEvent.USER_TRACKING data when that user is "LOST".

This thing needs to ship end of week. I thought I could handle this by assigning an activeUserID and filtering based on that but it just doesn't care. When it "LOST USER" it is game over even if that was just someone watching and then moving away.

View 1 Replies

Flex :: User Interface - Spark Datagrid And Word Wrapping

Nov 18, 2011

I would like to have a spark datagrid that wordwraps all rows where relevant. At the moment it appears like the width of a cell is dependent on the contents of the first row and then subsequent rows are word wrapped. For example:

[Code].....

How can I get the datagrid to dynamically resize to 100% of the container width and for wordwrapping to happen on all rows? (not just rows after row 1)

View 1 Replies

ActionScript 3.0 :: Create A Drag And Drop Game When The User Drags A Word Into The Box

Apr 29, 2009

ive got the following code. bevvy is a movieclip, theres a dynamic text box called feedText nd a box.. imaginately called box. I'm trying to create a drag and drop game when the user drags a word into the box that will have its meaning beside it in a text box, the dynamic text box will tell them if they are right or not. if they are right the word stays, if not the word will go back to its original location. the dynamic text box will give feedback whether they are right or not.

the code below means that the word will stay in the box, but the text message is displayed all the time. i also have a reset button to make the word return to its origal location but id rather not have the button.

[Code]....

View 2 Replies

ActionScript 2.0 :: Playing Specific Sound Files Based On Letters In User Entered Word?

Nov 19, 2006

I was thinking that it may be possible to create a primitive, yet usable actionscript based text to speech system for Flash movies (One that is platform independent).

Is it possible to right a series of actionscript commands that would play a collection of certain sound files based on what word or words the user has entered?

For example:

If the user types "Red Pen"

Can actionscript tear apart those two words and play sound files "Arr", "ee", "Dee", "Pee", "ee" and "EN"?

If it is possible, and if someone could help me out on it, then I'll start figuring out what phonetic sounds I'll need to record and program, and see if I can't build a simple text to speech program for flash movies.I have no immediate commercial application for it, and I don't plan on one.So if I can pull it off it'll be free to everyone, source code and all. Of course, it may be in my voice, but it shouldn't be hard to take what I plan to do and use it as a template for anyone else's voice recordings.

View 2 Replies

ActionScript 2.0 :: Word Filter With Actionscript?

Mar 17, 2010

im trying to make a simple word filter..heres what iv got so far.

Code:
var badwordslist:Array = ["badword1","badword2"];
button.onRelease = function () {
checkswears();
}[code].......

namebox is an input text field and errorbox is a dynamic one.i want it so if you enter a word inside the badwordlist array it will display what is inside errorbox and erase whats inside namebox.iv had mixed results so far. i thought i had it working but when i put in a different word it also made the errorbox msg appear.errorbox and namebox are both the var name for each as well..

View 2 Replies

Flex :: Give MS Word Like Interface To User To Expand Or Contract Display Object's Like Canvas, Images

Dec 9, 2009

How to give a ms word like interface to a user so that he can enlarge and contract the display objects like Images, canvas, Hrules etc. at runtime in an web application?

View 1 Replies

IDE :: Text Panel Properties Doesn't Allow To Underline Text Or To Highlight And Edit A Single Word In A Whole Text Box - Missing?

Oct 1, 2009

I used to have a little text panel (that sat with the color, swatches, and align panels) that I was able to open up and edit text size, color, underline, etc with. It had a much better text editing ability then the properties panel, seeing as the properties panel does not even bother to allow me to underline text or to highlight and edit a single word in a whole text box. Now I don't have it, I can't find the damn thing anywhere, and I want it back. How can I get it?

View 1 Replies

ActionScript 2.0 :: Determine User Resolution - Single Horizontal Line To Go Across 100% X 100% Stage?

Jul 11, 2007

I would like a single horizontal line to go across my 100% x 100% stage, but how do I do that? Im thinking its about knowing what resolution the viewer has, and the writing a script for the line, but how?

View 2 Replies

ActionScript 3.0 :: Create A SWF And Store User Variables That Control The Playback And Make It All Contained In A Single SWF File?

Jul 12, 2009

I am looking for a class that functions similar to JPEGEncoder from as3corlib, but instead of encoding a JPEG, I want to take a dynamic drawing the user has made (with animation) and output an SWF file that the user can download and playback on his/her computer.I understand how to create an SWF and store user variables that control the playback, but I want to make it all contained in a single SWF file.

View 1 Replies

ActionScript 3.0 :: Selecting One Letter From A Word Array (to Start Off A Word Game)?

Jan 2, 2012

I have been building a simple word game. It is smple but works fine. I am now trying to enhance some of the features.I would like to see if I can display one letter of each word so the Player has a hint. Think of this as a beginners level.The words are random from a text list. Either I can make the letters invisible and the game starts without a hint or I am able to select a letter using charAt() or creating a new variable substring()from the word which is the displayed repeatedly on the stage(not what I want) I have not been able to find a way to display one letter and display it in the correct order within the word and keep the remaining letters invisible.
 
import flash.net.URLLoader;
import flash.events.Event;
import flash.display.MovieClip;
import flash.text.TextField;

[code]...

View 6 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved