This is a discussion on "search a text FILE BY FIRST CHAR OF WORD" within the Flash & Multimedia Forum section. This forum, and the thread "search a text FILE BY FIRST CHAR OF WORD are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
search a text FILE BY FIRST CHAR OF WORD
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
search a text FILE BY FIRST CHAR OF WORD
i need to create a flash based search engine where a user can enter a search string and then find the same string from a text file
for Example text file contains : HELLO HOW ARE YOU. WHAT IS YOUR NAME. ARE YOU FEEL COOL ?. HI HOW ARE YOU. HE HAD HAHAHA HAHAH AND USER INSERT : H H A THEN OUTPUT SHOULD BE : HELLO HOW ARE YOU & HI HOW ARE YOU & HE HAD HAHAHAH MEANS SEARCH UPON FIRST CHARACTER OF THE SENTENCE |
|
|
|
#2
|
|||
|
|||
|
I will have a little bash at this and see what I can come up with!
You just want to search for the first character of the sentence? |
|
#3
|
|||
|
|||
|
Ok Just tell me i have a simple text file containing some running text line by line
text file example : this is good. this is bad. This is cool. This is ugly. Now how to store each line in indvidual variable |
|
#4
|
|||
|
|||
|
Ok I have solved your first question entirely and have uploaded a FLA file which does exactly what you want. It was a bit of a challenge actually!
I have included plenty of comments in the code, which you will find by right-clicking on the "Search" button and clicking on actions. Sorry if you're not fluent with general programming or actionscript. If you are fluent with general programming principles then this shouldn't be too hard to pick up. If not then please ask us questions about what you don't understand and we as a forum will do our best to help you out. You will find the online version here: http://www.digital-end.com/webforumz...ch_engine.html You can edit both the input and searchable sentences. And here is the FLA: http://www.digital-end.com/webforumz...rch_engine.fla In response to your last question: "Ok Just tell me i have a simple text file containing some running text line by line?" Well, I split it by sentences ". " but you can also do line by line by telling flash to split it by "\n" which in text terms is a new line. Hope i've been of some help to you! |
|
#5
|
|||
|
|||
|
Oh and for those of you who are lazy, here is the code:
Objects are: searchtext, input_t, output and the search button itself. |
|
#6
|
||||
|
||||
|
Great solution. Have done something similar myself. I'll try and dig it up and post it here.
|
![]() |
| Tags |
| search, text, file, first, char, word |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| search xml content for a specific word | karloff | PHP Forum | 2 | May 8th, 2008 18:46 |
| Converting Word Document to PDF file. | akshitshah | Scripts and Online Services | 5 | Jan 8th, 2008 07:25 |
| print file (pdf, jpeg or word doc) | ecat | JavaScript Forum | 0 | Sep 15th, 2006 18:28 |
| Pasting Word Doc into Text Area | Paula | Web Page Design | 6 | Aug 25th, 2006 09:15 |
| How make Word file same as html file in ASP | humair | Classic ASP | 5 | Sep 24th, 2003 14:35 |