Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Word Find

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I need help creating an interactive word search in Flash. I am not sure where to start, I have played around with a couple of different ideas, but nothing seems to work. If anyone has done one and has a solution, it would be greatly appreciated. Thanks.
 
You can search any variable within Flash using:

indexOf("thisString", index)

where "thisString" is what you are looking for, and "index" is the point in the target string you want to start from. The search string will probably be generated by the user in an input textfield, so it will be stored in a variable, such as "searchWord". You can use that variable to check its contents against any other variable's contents, with code on a "SEARCH!" button like this:
Code:
if (myVariable.indexOf(searchWord, 0) > 0){
    trace(searchWord + " found!");
}else{
    trace("Sorry, " + searchWord + " not found");
}
That's the first step. A trace statement will tell you there is a match. There are a million places to go with this. You may want to highlight the match in the textfield. You may want to allow the user to continue searching the rest of the target variable. You may want to show results, including how many matches were made. You may want to enable wildcard searches, case matching, part-word matches ... all these things are possible.

How about you let me know what EXACTLY it is you want to do ...
 
Ah ... jumping the gun there. I thought you meant a text search. A game, eh? Try Flashkit - there may be some tutorials or open source FLAs that might be of help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top