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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

searchable flash - is it possible???

Status
Not open for further replies.

orangejuice

Technical User
Nov 18, 2002
33
CA
I am setting up a large interactive CD interface basically containing information from a 300 page users manual. This is meant to make things more accessible and easy for customers to use than flipping through a huge book.

The flash files are set up to load text dynamically from many different .txt files. I would like to include a search function in the main flash movie, which basically searches the external .txt files and returns a list of keyword matches, which would be links to load that .txt file. Is this possible in flash, and are there any tutorials on this sort of thing??

Any help is appreciated!
 
I asked the same question on another forum some time ago. This is the reply I got.


A lot of people have asked me how to search in flash, so here we go:

Flash can not search!

However - it can send variables and load variables to/from an ext.
file/source. A cgi script can search text-files or databases - and
furthermore print variables.

All you have to do is set up a search-script on your server and use flash to
send/load variables from the search
results. Modify the search-script to print 'plain/text' instead of the usual
HTML, so that variables loads correctly (var1=whatever&var2=whatever).

In flash do the following:
Make a movieclip (mc1) and place your textFields and buttons here. You need
a 'Query'-field, a 'Results'-field and a 'Search'-button. Make sure all the
names correspond with the cgi-script.

Use the loadVariables on your search button in flash like this:
// do the search and load the new variables (search results).
on (release, keyPress &quot;<Enter>&quot;) {
Submit = &quot;Search&quot;;
loadVariables (&quot; &quot;_root.mc1&quot;,
&quot;GET&quot;);
}

Make a function 'searchUpdate (update)' where you use setVariables to update
all variables like this:
// Flash will not update textFields unless you make it.
function searchUpdate (update) {
_root.mc1.textField1 = _root.mc1.textField1;
_root.mc1.textField2 = _root.mc1.textField2;
}

Then you use the onClipEvent on mc1 to let the function do its magic like
this:
// When 'mc1' receives data you want it to update all variables, so run the
'searchUpdate' function.
onClipEvent (data) {
_root.searchUpdate(update);
}

Furthermore it is also possible to pass values to functions from an external
source, using the undocumented 'asfunction:myFunction,value' option.

Hope this helps!
 
Thanks... I think! I'll try to figure out how to do this from this post - did you ever manage to get it to work???
 
yes i got it work but not really by using this post. I got the client to agree to a php/mysql backend which made it all quite straightforward.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top