Hello all,
here's what I want to do: I need a simple CV search function for a small site. There will be two fields: on the first field the user will input a Name or Surname and on the second field the script should return one or more results taken from a pool of names + surnames that should be clickable links to the respective .htm page of each cv. Is this possible? From what I've seen people use the replies in the second field as simple text and not as links... Any tips are welcome, thanks.
// assuming the results can be fed into an array
// that defines the name and the link (see below)
arr = [
{nme:"bob",link:"bob.htm"},
{nme:"ben",link:"ben.htm"},
{nme:"tom",link:"tom.htm"}];
resultsTxt.html = true; // instance name of dynamic textfield
this looks real neat and easy to update but I can't seem to make it work. Can you please have a look at the attached .fla? I had to change resultsTxt.html to resultsTxt because Flash wouldn't let me use it as instance name...
Ah ok, I see what you mean. Thanks for your reply but what I want is a bit different from that. I want one input text field where the visitor of the site types a name (Ben, Jones or Ben Jones) and when they click on a submit button the full name (Ben Jones) appears inside a dynamic text field below with a clickable link that when pressed takes them to a page like benjones.htm. If no input text matches any name in a given list, there should be a non linkable text appearing in the dynamic text field (something like "no results found"). I resaved the above movie as Flash 8 [AS2] and tried to somehow trigger it by putting some actions on the submit button but I now see it's not how you meant it. Is it possible to adapt it to smth like that? Thanks again for your time.
note: to open a url, remove the comments from the getURL line,
and either post the files to your server to test, or include your
development folder to your safe locations in the Settings Manager
Sorry to bug you again but something seems to be preventing it from clicking through. The results display fine below, when I roll over them there is a hand/link cursor change indicating it's a link but when I actually click on them nothing happens. No error, no warning of some sort, nothing. I tested it on Explorer 8 and Mozilla 4.5 with latest Flash plugin installed and the results never click through. I tested the movie you sent me too and it also refuses to click through (tested all both online and locally with dev folder set as trusted)...
just to be sure
you have removed the comment operator on the getURL line ??
// getURL(param,"_blank");
should be -
getURL(param,"_blank");
ActionScript 2.0 Language Reference
ActionScript language elements > Operators >
// line comment delimiter operator
Indicates the beginning of a script comment.
Any characters that appear between the comment delimiter (//)
and the end-of-line character are interpreted as a comment and
ignored by the ActionScript interpreter.