PDA

View Full Version : adding google search in flash



kev
August 24th, 2002, 05:51 AM
Hi guyz was wondering if this is possible in flash 5:

I have the script for adding a google search to my site, but it's in html:


<!-- Search Google -->
<center>
<FORM method=GET action=http://www.google.com/custom>
<TABLE bgcolor=#FFFFFF cellspacing=0 border=0>
<tr valign=top><td>
<A HREF=http://www.google.com/search>
<IMG SRC=http://www.google.com/logos/Logo_40wht.gif border=0 ALT=Google align=middle></A>
</td>
<td>
<INPUT TYPE=text name=q size=31 maxlength=255 value="">
<INPUT type=submit name=sa VALUE="Google Search">
<INPUT type=hidden name=cof VALUE="AH:center;S:http://www.liquidsource.co.uk;AWFID:18bc198dbbce8a42;">

</td></tr></TABLE>
</FORM>
</center>
<!-- Search Google -->

Is there a way of doing this in Flash 5 or adapting it to work, basically through a flash text field and a flash button!

Thanks for any suggestions

btw - I can't get the code to show as text! how do i disable it in this forum?
Kev

<B>EDIT: Edited by lostinbeta to show the HTML code</B>

lostinbeta
August 24th, 2002, 11:12 AM
To enable HTML code in this forum click the PHP button in the vB Code section when you post a reply. It is with all the other grey buttons and the drop down boxes for size, font, and color.

It took me ages to figure out how to do it, but then dan4885 edited one of my posts to use it like that and it worked.

There is a tutorial on kirupas site about adding an atomz search field, maybe this could be some help.

http://www.kirupa.com/developer/mx/atomzsearch.asp

I don't know if you can do it for google considering you would need an ID #, and since you can't sign up for google, you won't have an ID #. But it is worth a try to see if you can get it to work.

kev
August 24th, 2002, 11:36 AM
Thanks. I figured it out in the end thanks to xxlm, here's how -

Simply add an input textfiled, give it a variable: q

Add a send button and put this script in it:


ActionScript:--------------------------------------------------------------------------------on(release) {
getURL("http://www.google.com/custom?q"+q, "_blank", "GET");
}

--------------------------------------------------------------------------------

Maybe someone could put this in the tutorial section?
It's a handy thing to know!

Kev :)

lostinbeta
August 24th, 2002, 11:41 AM
That is a handy thing to know. I love google, it's the best search engine I have tried thus far. I have no use for a search engine field in my page, but I am sure many other people do.

vip3r
August 24th, 2002, 11:43 AM
after taking a quick glance, i think i know how to do it.
following the atomz search tutorial, just instead of pasting that actionscript, paste this:
on (release, keyPress "<Enter>") {
address = "http://www.google.com/custom?q=" + url + "&sa=Google+Search&cof=AH%3Acenter%3BS%3A%3Ca+href%3D";
getURL(address);
}

this may or may not work, if it doesn't, tell me the error message. PM me or just reply.

vip3r
August 24th, 2002, 11:44 AM
lol, guess im too late- u guys did that when i was typing that message.



no problem

kev
August 24th, 2002, 12:03 PM
vip3r - Thanks for the input anyway! ;)

Kev :)