My supery-dupery new design for Alan Unleashed games was getting a bit boring, so I decided to add a search box. Just a plain old search box, pointing to Google's sitesearch. Simple to do? No.
I spent about 3 hours looking on discussion forums and tutorials for ways to convert html to flash - but no-one had made a useful one hitting the nail on the head for a Google search, so here is what I am going to do.
To create a button, just create a normal box or circle, and perhaps you could put the word "Search" over it, then convert it to a button.
That's that done for now, so lets move onto the input box. Select the text tool on the "Tools" toolbar, and on the menu under the "Properties" tab select "Input Text". (Any formatting changes you can make when you have got the functionality done.) Now type "q" in the variable box shown below.
Putting "q" will tell the search form to add "?q=" to the end of the url that you specify it to go to; which is the next step.
To tell the form where you want the form contents to be directed to, click on your "Search" button and press "F9" to bring up the actions panel. Type:
on(release){
getURL ("http://google.com/search", "", "GET");
}
Next step, select the grey area surrounding the contents of your frame, and press "F9" again (assuming that you closed it), and type in the following, replacing it with your site's url of course:
sitesearch = "alanedwardes.com";
You now have a fully functional google website search! If like me most of the time, you cant be bothered to follow the steps above and prefer a file to work from, scroll down.
example.fla - 32kb The editable flash source file.
example.swf - 4kb
The working example.
So nice of you, its very helpful