Skip to main content
Participant
March 9, 2007
Question

Google Search

  • March 9, 2007
  • 1 reply
  • 207 views
Can anyone please help me?

I was wondering How I would be able to add a google search bar onto a .swf.

The bar must be able to open a new window to a google searsh page of what you typed in the box. The bar must also add a set text before what you actually tpe in.

So if You type "man" into the bar and press a button a new window will appear showing the searh results to "the man". "the" will not be text that is added to the search but you get the idea.
This topic has been closed for replies.

1 reply

Inspiring
March 9, 2007
Sure.

Add a input TextField -- assign an instance name: "myGoogleQuery"
Add a button -- assign an instance name: "myGoogleButton"

Add this script:

myGoogleButton.queryTextField = myGoogleQuery;
myGoogleButton.onRelease = function(){
getUrl(" http://www.google.com/search?q=" + this.queryTextField.text,
"_blank");
}


Participant
September 9, 2008
Ray I used the code and I am am getting an error message from Flash stating:

"statement must appear within on handler"

In regards to:
" myGoogleButton.queryTextField = myGoogleQuery; "

and also:
"myGoogleButton.onRelease = function(){ "

any help? I have been trying to get this search box to work with google. stressed out. Thanks.