ActionScript 2.0 :: Search String In TextField Then Do GotoAndStop Action
Jul 23, 2008
If the word "book" is part of the text entered in the text field "mytextfield" the flash should do the action "GotoAndStop(2)". I tried this, but it didn't worked.
Code:
function search() {
var box = this.mytextfield.text;
trace(box);
var str = box;
if (var location == str.indexOf("book")) {
GotoAndPlay(2) ;
}
View 9 Replies
Similar Posts:
May 2, 2003
i want to do this:
on (release) {
_root.nextMovie = "externalmovie.swf";
_root.cover.gotoAndPlay("close");
[code].....
View 1 Replies
Jan 14, 2010
How can I search a string for containing another string?
Like "I like pizza." search for "pizza", and if it has it, return true, but if it doesn't - false.
View 2 Replies
Jun 17, 2010
i'm just trying to search a string! how?!
treeROOT = [];
// loop through all markers in the XML and place into ROOT array
for each (var xmlNode in xmlData.category) {
[code].....
tho i get an error here : and pretty sure it's from some bad use of .indexOf (because if i comment out that indexOf conditional, it works fine).i'm confused by the AS reference for indexOf, as it appears to be used for both Arrays and Strings.[URL]
View 3 Replies
Apr 25, 2011
i like to stay away from a loop if possible.
i have a string like this.
"<person><uid>bob</uid></person>"
i want to read the bob between the uid tags is there any easy way to do this using regexp or ay other method i have writers block here.
i should also metioned the string between <uid> and </uid> is variable length so i would really just like to read in between the uid tags.
View 2 Replies
Feb 16, 2011
I'm trying to create a simple xml search function that searches an xml file for a string, and if that string is found in the xml, display the node which contains that string in a text box.I have the simple search function working, but what I can't do is return the specific node. Right now, the function is returning all the xml data instead. If someone could take a look and possibly lend some guidance as to how to return the specific daya, I would be much oblidged. Hope this makes sense, if not, let me know and I'll do my best to clarify.[code]
View 6 Replies
Mar 6, 2012
I want to search some muliptle tag in a String and their index . i can get serach() but it gives only first occurence of a word,not for all.
View 2 Replies
Sep 17, 2011
I have a TextArea that allows user input. I also have TextInput that the user can type a string into and I want to be able to search through the TextArea for the string in the TextInput. I've never done anything like this before, searching for strings, so I don't know which functions to use or how to go about it.EDIT:
protected function searchBtn_clickHandler(event:MouseEvent):void
{
text = mainTextField.text;
[code].....
View 1 Replies
Aug 1, 2009
I was wondering if there is an easy way to search a string for a keyword. I am working on a twitter piece which searches strings for keywords and have found a way of loading all the data properly.
View 1 Replies
Dec 11, 2010
My htmlText in AS2 looks like:
<TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Arial Bold" SIZE="20" COLOR="#A68500" LETTERSPACING="0" KERNING="0">Detroit Central City</FONT></P></TEXTFORMAT><TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Arial Bold" SIZE="20" COLOR="#A68500" LETTERSPACING="0" KERNING="0">has served over</FONT>
[Code].....
This replaces the 2 but of course also replaces all the other instances of 2 in the htmlText as well. Is there any possible workaround? Can I exploit the fact that the other 2's are inside quotations and someone not mess with those ones based on that fact?
View 1 Replies
Nov 24, 2009
I've been trying to use substr to loop through some text in a textfield I have cast as number.Although there is a problem with this, substr only goes through strings so if I type something as a number, it wont loop throught.Is there a similar function to loop through numbers?
View 3 Replies
Nov 19, 2011
I'm looking for the best way to search an 8 char string in AS3 to see if it contains a word or words. I've already got a dictionary of words loaded into Flash, with.[code]...
View 3 Replies
Jun 2, 2011
search and replace text nodes from following string:
MY ORIGINAL STRING:
var strTemp = '<p><text textId="textVariable1">This is my first text node.</text></p><question type="first">This is a first question.</question><p><text
[code]....
View 0 Replies
Mar 25, 2008
way to search a string for html links, the reason i ask is so that when my clients update their sites using external text files, all they have to do is type in [URL] and when the var is imported into flash it will be converted into <a href="http://www.somewherenice.com">www.somewherenice.com</a> so my clients don't need to learn lots of html coding.
View 11 Replies
Jun 7, 2009
I need to be able to get the int returned on this. If I serach for any letter as a string I get the search function working right. If I run it like it is below I get back 0, which I should get 3.
[Code]...
View 3 Replies
Jun 24, 2009
String.search function thinks that dot and comma (. and ,) is the same thing. Is there a way to fix this? I want to find comma and it gives me a dot.
View 2 Replies
Aug 6, 2010
I am trying to do a search that locates the string anywhere in the RSS feed and is case insensitive. I have it working fine when it's still case insensitive but when I throw in the /i I break it.
[code]...
View 4 Replies
Aug 25, 2011
My designer provides me lots of MovieClips containing buttons and its states and most of them contain a TLF TextField. Now I do not want to check each MovieClip where a TLF TextField is used. Can I know exactly in which MovieClips and buttons a TLF TextFields has been used so that I can convert them to a classic TextField, or any method to convert all TLF TextFields to classic automatically by the compiler itself? I tried deleting the TLF library from publish settings: it starts giving me an error, but still not pointing me to where TLF TextFields are being used.
View 1 Replies
Oct 3, 2009
I have a file with html text and html code. I load this (test.txt) into a dynamic textfield. Then I want to do this with String functions: String Str1 contains the value I want to search for in the textfield. Str1 = "<script language="javascript">AC_FL_RunContent = 0;</script> <script src="AC_RunActiveContent.js" language="javascript"></script>" Search textfield after Str1 remove Str1 value from textfield My goal is to clean my html-file/textfield after all script java tags. The tags that Flash CS3 automatic puts into HTML file to activate AC_RunActiveContent.js
View 0 Replies
Jul 14, 2011
I was interested in searching through the text in a textfield and applying formatting to key words. For example, every time the word 'the' appears, apply a text format the changes it to green and 14pt.[code]...
View 0 Replies
Apr 12, 2005
I need to create a search "thing"! I have a database with, for ex., 10 names, with age, color of eyes and hair. I need to create some form were you choose to search for someone between 20-30 years, blue eyes, brown hair, and then the results appear on a list with links to each case... did I made myself clear?
View 1 Replies
Nov 27, 2007
I have a string that looks something like this:
TestString - "1,0,0,0,0,0,1,0"
I need to create some sort of loop (I think) to search though the string and look to see if it contains any 1's.
View 3 Replies
Jul 12, 2009
i have a input text field on stage called textfield and a button called btn i want to be able to search for key words from the users input i found this code but it doesnt work,
[Code]...
View 2 Replies
Jul 22, 2009
I have an array index problem. I have an Array that holds some strings. I am trying to write a function that receives a string variable (user input)and searches for that string in the array. for that i tried to use "ArrayName.indexOf(input_variable)" but this always returns -1 even if the string which the variable holds is in the Array.
This is the script:
public static function ValidName(inputName:String = ""):Boolean {
trace(validNames.indexOf(inputName));
if (validNames.indexOf(inputName) > -1) {
return true;
} else {
return false;
}}
View 4 Replies
Apr 12, 2011
my objective is:
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?
View 3 Replies
Oct 8, 2006
i'm trying to write a function but with no luck. seems my brain capacity's limited the function will take two parameters: a term to search for, and a string to be searched. what i want the function to return is a new string containing the term (the parameter) along with a couple of words before and after it (as found in the search string).
View 2 Replies
Nov 8, 2006
i am building a little widget that allows a user to type in keyword(s) into one input field and then a zip code into another
when the user clicks submit, it plugs them into the search url
i have it working for one input field, but i am not sure how to append the script for the second field...what would i need to change to the below script to add a second field into that query string?
Code:
btn.onRelease = function(){
getURL("http://www.google.com/search?q="+myInputField,"_blank");
}
View 4 Replies
Jun 1, 2007
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.
View 2 Replies
Feb 8, 2007
I have a movie clip on the stage and have given it the instance name "team1". inside this movie clip there are two states. at frame1 it says one thing, then at frame 10 has an image. team1 stops at frame 1 and what i want to do is when the main time line reaches say frame 50, i want the team1 movie clip to gotoAndStop at frame 10, thus showing the image and not the text. i tried doing it by putting this on the main timeline at frame 50: team1.gotoAndStop("team");
View 2 Replies
Aug 2, 2009
on the mainTimeline if have a movieclip. inside this movieclip i have a script that loads text from database. what important note is: var myPageText: String
now if i place inside this movieclip a other label further in the time, and create a action to call out myPageText like: my_input_text.htmlText = myPageText; this works fine
now i want this to work inside a other movielip in other scene. is it possible to call myPageText???
View 11 Replies