Unlimited Plugins, WordPress themes, videos & courses! Unlimited asset downloads! From $16.50/m
  1. Code
  2. ActionScript

Quick Tip: Create a Basic Google Search App in Flash

Read Time:2 minsLanguages:

In this Quick Tip, I will show you how to create a basic search application featuring the Google search engine.

Final Result Preview

Let's take a look at the final result we will be working towards:

Step 1: Brief Overview

Using a TextField and some Events, we'll send the search terms to Google and display the result in the browser.

Step 2: Set Up Your Flash File

Launch Flash and create a new Flash Document, set the stage size to 320x100px and the background color to #181818.

Step 3: Interface

This is the interface we'll be using, it includes an Input TextField and a button. Set the TextField instance name to searchTerms and the button to searchButton.

Step 4: ActionScript

This is the class that carries out all the work, please read the comments in the code to fully understand its behavior.

As you can tell by reading the code, the key is the Google URL that lets us add the search terms to the query, this is http://www.google.com/search?q=[search terms here].

You can also try this example with different search engines such as Yahoo! for example: http://search.yahoo.com/search;_ylt=?p=[search terms here] or ActiveTuts: http://active.tutsplus.com/?s=[search terms here].

Step 5: Document Class

Remember to add the class name to the Class field in the Publish section of the Properties panel.


You can create simple and effective search boxes using this technique, try different search engines and create your own search box!

I hope you liked this tutorial, thank you for reading!

Looking for something to help kick start your next project?
Envato Market has a range of items for sale to help get you started.