so i search for keywords ofc, but...doing this isn't really my thing:input.text.indexOf("spam") != -1 && input.text.indexOf("more") ! -1 && ... etc I'd like to make it some what like:input.text.indexOf(<database>) != -1
For a word matching game, when a player moves a piece I need to check the entire dictionary to see if the the word that the player made exists in the dictionary. I need to do this as quickly as possible. simply iterating through the dictionary is way too slow.
What is the quickest algorithm in AS3 to search a long list like this for a match, and what datatype should I use? (ie array, object, Dictionary etc)
1.Read in a text file. e.g containing text like this, teacher/student/1/sn/2/3/4/5/9/f/tn/02/
2.pass it to a string.
3.then beable to extract different parts of the string and place them in different arrays.
The bit I dont know how to do is the extracting specific parts of the string? Is it possible to search for / and to treat what comes after it as a specific peice of information until the next / is read? Or perhaps there is a more efficient approach?
I have a document class which is linked to an external class that defines the properties of a specific textfield. When the user submits the text in the textfield (whatever they typed into it) I would like the text to be broken up into the individual words and have those words placed into separate movie clips (the same instance of a movie clip, just each word placed into a different one). How can I do this? Here is the code I am using.
Code: function replaceText(event:MouseEvent):void { //beginning of the function for the submit button
I'm trying to apply a format (specifically, green-colored text) to specific words in a TextField. I tried the below method, checking for words in an array "commands", and it works fine apart from a few issues below (see pic).
ActionScript Code: var commands:Array = ["green", "no"] // etc. function formatGreen(msg:TextField):void { for (var i in commands) {
I have a question about textfields and I'm wondering if it is possible to change text styles of single words or lines within a textfield with actionscript.
I use an empty textfield and add my text to that field in actionscript with the following code: myTfield.text = "insert text here"
the text contains multiple lines and I want some of them to be bold, italic or a bigger font size. The reason why I am adding my text to my textfield this way is because I need the text in the textfield to change when some buttons are pressed. Text will be added or removed from the textfield if buttons are pressed by the user and the current way I'm changing the text is by simply re-using the code above with new text in it. (it makes the code quite long though, but I guess I'll have to deal with that) But because I'm adding text this way I am not sure how to change the style of different parts of the text.
On a related note, with CS5 there are now a number of options for textfields. There is TLF text and classic text. I've searched around for the differences but I don't find the awnsers very clear. What option should I use for my textfield if I want it to look sharp like the text I'm typing here (its just regular text, no headers or anything). Some options just give blurry text because of the anti-alias and some settings don't seem to change a thing. And at times embedding fonts looks nice but sometimes it makes it worse. There are so many options to choose from, but it is unclear what would work best for regular text. (my text won't animate, it does move with a scrollbar, but I only care about how it looks when the scrollbar is still)
i have a 2 row dynamic textfield 200px long.if more text than fits is entered i want to cut the last words that dont fit plus put 3 dots at the end ...
it is possible to change text styles of single words or lines within a textfield with actionscript. I use an empty textfield and add my text to that field in actionscript with the following code:
myTfield.text = "insert text here"
the text contains multiple lines and I want some of them to be bold, italic or a bigger font size. The reason why I am adding my text to my textfield this way is because I need the text in the textfield to change when some buttons are pressed. Text will be added or removed from the textfield if buttons are pressed by the user and the current way I'm changing the text is by simply re-using the code above with new text in it. (it makes the code quite long though, but I guess I'll have to deal with that)But because I'm adding text this way I am not sure how to change the style of different parts of the text.
On a related note, with CS5 there are now a number of options for textfields. There is TLF text and classic text. I've searched around for the differences but I don't find the awnsers very clear. What option should I use for my textfield if I want it to look sharp like the text I'm typing here (its just regular text, no headers or anything). Some options just give blurry text because of the anti-alias and some settings don't seem to change a thing. And at times embedding fonts looks nice but sometimes it makes it worse. There are so many options to choose from, but it is unclear what would work best for regular text. (my text won't animate, it does move with a scrollbar, but I only care about how it looks when the scrollbar is still)
I'm trying to figure out how to get this started. I'd like to type a word in a textfield and have it search for a match through a list of words in xml. There would be 26 xml files containing a list of words starting with a letter of the alphabet.
I'am making a advanced mp3 player arund this tutorial: [URL] and i want the users of the player to see how long they have listen or how long time back of the song. i have the AS i what to use but i cant connect them. becuase the tutorial i used does not make a sound objekt (MUSIC)
I'm trying to play a 10 minute long video (h264/mp4) which is 39MB in size, after I call stream.play(fileURL) it doesn't start playback until its loaded around 12-16MB of the file (many many seconds later), I finally get onMetaData at this point too. Why doesn't it begin playback right away, or at least w/in a couple seconds? What can cause this bloated lead in time?
Anyway, I want to do something really basic and simple. I want to have a word fade in then fade out. Then another word in another place fade in and fade out.
I draw a red color circle,likefollows:graphics.beginFill(color);graphics.drawCircle(0,0,radius);graphics.endFill();Then I want to write a yellow color word in the middle of this circle,for example,I write 'Menu A' in the middle of the circle,what code can I use?
I have a word,its content is follows:var txt:String="abcdefg";I want to show word from the first letter to the last letter,the word effect is one by one. For example,at the beginning I only show the first letter 'a',the 'a' size is big,such as 30,and then the letter 'a' size minish gradually to 20.Then show the second letter 'b',first,the letter 'b' size is big also,such as 30,and then the letter 'b' size minish gradually to 20,and the letter 'b' is behind the letter 'a',and so on with letter 'c'. When all letters show,the effect stops.
I want to have serveral different words to appear on my stage with their own buttons. Here is my code for your review. Process.visible = false; Cycles.visible = false; stop(); function playMovie(event:MouseEvent):void { play(); [Code] .....
I am trying to convert an entry using a numeric stepper in flex into words to display in a textarea.i.e a user uses the stepper to enter "89" as a value and in the text area the words "Eighty nine" are displayed.After much searching i haven't found anything that helps - a few javascript functions but that is all.
I have a button that inserts an mc named coin, and adds a number to the end. So if you hit it, it will make coin 1, then coin2, then coin3, ect. I wan't to have a hit test in an mc named character to check if it his any of the coin mc's.
I have a sentence that's basically items from an array, and I have this line that when I type one of those words on it, that word is removed from that sentence/array. And I'm having trouble coming up with a function, I'm trying to make it an if statement.so far I tried: and I know I need to put splice in, but this is just to see if it works or not.
I have a word,its content is follows:var txt:String="abcdefg";I want to show word from the first letter to the last letter,the word effect is one by one. For example,at the beginning I only show the first letter 'a',the 'a' size is big,such as 30,and then the letter 'a' size minish gradually to 20.Then show the second letter 'b',first,the letter 'b' size is big also,such as 30,and then the letter 'b' size minish gradually to 20,and the letter 'b' is behind the letter 'a',and so on with letter 'c'. When all letters show,the effect stops.
For a rather complex search function I need to get the first letter of each word entered into an input field. At first glance this may not seem like a big problem if every word is neatly seperated by a space.
Although people can enter whatever they want into the field I only want to work with the words that start with a-z or A-Z.
I'm having a bit of trouble figuring out how I can determine if a character in the string falls into this selection. One of the possibilities is to use charCodeAt(), but that's rather rough. I can walk through the string using indexOf() but I may have trouble finding the next word if characters other than a space come into play.
I'm creating a little interactive art game in Flash MX 2004 that is based on the old ZORK type interactive text only games, although mine has visual content as well. I've got the script working as far as sending the user to my chosen frames when a reply is typed and the enter key is pressed, but I'm having trouble with my "curse words" feature. What is want is that when the user types a swear word and hits Enter, they will go to the "swear" frame where they are scolded and sent back to the beginning of the game.
I can guess the most likely swear words to be typed, but I'm not sure how to write the script to make Flash watch the input field (variable name is reply) and know when one of the target words is typed, and then send the user to my "swear" frame. This functionality needs to be on just about every frame.