ActionScript 2.0 :: Search String - Result Appear On List With Links
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?
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.
I'm trying to populate a spark list component from SQLite in an AIR application statusList = new ArrayCollection(statement.getResult().data); myList.dataprovider = statusList; From the debug session I know the data is structured as statusList->unnamed object->array
statusList = new ArrayCollection(statement.getResult().data);yList.dataprovider = statusList;From the debug session I know the data is structured as statusList->unnamed object->array
In the following example (yes, I am coding on my timeline while I try to work this out - I know, I know) I am loading an SWF in an HTML page and then directing the SWF to get the query parameters from the current URL. The query parameter will contain the source for the video to play.
This seems straight forward to me but I cannot get myURL = urlVars.videoloc; to work. More specifically, urlVars.videoloc seems to be undefined rather than holding the query parameter from the URL. All other variables are correct; both wholeURL and urlVars are defined.[code]...
I'm trying to do a test on the length of a string and then call a function depending on the result. This is the pertinent excerpt from the fla file:
Code: _loc4._comment = candles[_loc3].comment; // I want to find out the length of _comment and call differently depending _loc4.onRollOver = function () { if (_loc4._comment.length > 0 && _loc4._comment.length < 60) { show_comment(this._comment, this._x + this._parent._x, this._parent._parent._y - 50); } else { show_comment(this._comment, this._x + this._parent._x, this._parent._parent._y - 100); }};
Basically I want to check the length (in characters) of _loc4.comment and if its under 60 call with an offset of 50 and if its not call with an offset of 100.
I am having trouble searching through a list component and/or dataprovider to see if an item already exists. Basically i am adding items to the list when a item is dragged on to the list. But i want to check to see if an item is already added so not to duplicate items. any ideas would be great.
Suppose I have a list of objects of a certain custom type and I need to find an object given only the value of one of its attributes, how do I do it?
Eg.
// Where user1 ... usern are objects of some class User users = [ user1, user2, user3 ... usern ] // How do I find out the objects that have the "foo" attribute set to "bar"
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]
what i would like to do is create a search field that as the user types in the search bar if there are any matching entries in the list, the focus/selection jumps to that particular item in list. i don't want to clear the list just go to the item that matches.i would like it to be predictive so if i have these entries:and the user types "s" in the search box to the first "s" entry in the list (samson) is selected, if they type "se" the selection jumps to the first entry with "se" in it (seek) if they type "seet" the selection jumps to "seether" and so on.i have absolutely no idea how to do it, but more importantly...is this possible? Attachments: glossary.zip (1.0 MB)
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)
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.
Premesis:I am using actionscript with two arraycollection containing object with value to be matched...Let's assume I have two list of elements A and B (no duplicate values) and I need to compare them and remove all the elements present in both, so at the end I should have
in A all the elements that are in A but not in B
in B all the elements that are in B but not in A
now I do something like that:
for (var i:int = 0 ; i < a.length ;) { var isFound:Boolean = false;[code].....
I cycle both the array and if I found a match I remove the items from both of the array (and don't increase the loop value so the for cycle progress in a correct way).I was wondering if (and i'm sure there is) there is a better (and less CPU consuming) way to do it...
I'm planning to make a game that gives players the choice to search a word when selecting a character, and if that word is found, they get to play as them. I don't even have a clue what, where and how I am gonna put the list in the game for something to search it. I'll try to give an example:
A user puts "horse" into the input field, presses the "Search" button, and Flash searches the word "horse" in a list of maybe 30 or so words. If it returns no results, a message says, "keyword not found". If it is found, a picture of a horse comes up in the character preview box.
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]
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;
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.
I am new to this and have looked all over for tutorials and can't find a thing. I am looking to have a list box with a list of items that are called from an XML file. Each item would be linked to
I'm working on a dictionary using Flash components. I'm trying to implement a search field, I manage to filter word and letters, as you do on goggle. What I need is to filter from the beginning of the word as you do on a Dictionary.
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?
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?
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]...
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
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.