hide side navigation
    5 most recent
    Web Services
  Flash Spell Checker  Company information and news  LinkToMe  Flash Google MX  Flash Currency Conversion  Language Translation  Flash Server Inspector  Stock Quotes in Flash  Flash 2D and 3D charts
    Library's
    Component's
    Applications
    Articles

The Flash 6 (MX) Player is required to view this application

Please read over the below text - before downloading the application at the bottom

   
LinkToMe: Using the Google web services with AMFPHP to display links to a site.
   

Title: using Flash MX and web services (with AMFPHP) to display information in a better way, LinkToMe

Description: this application uses the Google web service to display links to a site. The results are filtered so only unique links are displayed. AMFPHP is used to communicate between flash and the webservice.

Category: Flash Remoting - Web services

Classification: Intermediate

Author: Jorge Solis

Site: Flash-db.com

 

   
 

Flash MX - Google Web Services API
This application is an example of using Flash MX to communicate with a Web Service (Google) using Flash Remoting, a PHP Soap Toolkit (nusoap) and amfphp. Because AMFPHP supports web services we can easily build applications such as these. The application makes a basic link request to google but displays the results graphically. It filters the results because google returns all results (most of the time from the same site). This application will only display unique links. At the time of this writing, Google has 218 links to flash-db, but only 39 are from different sites. If you check the checkbox next to "show info on press" you can access some additional information on the site linking to the site queried - as well as the actual link. The google application should prove useful to almost any site. It offers quite a few features and provides a graphical interface to one of the most used web services in the world. Hopefully this is just a starting point.

 

About
The google Web service's feature that we are concentrating on is an internet search feature. By using the google web service, Flash MX, and amfphp with Soap you can build your own version of Google. All the results will be the same, as if you had searched directly from Google.

 

Requirements

You need to have Flash Remoting components and the amfphp packet installed. If you are new to amfphp, then perhaps is better to first read over the "Hello World Remoting" tutorial, which includes specific instructions on installing both. It is especially important that your gateway.php points to your flashservices/app/Gateway.php folder. Finally, the nusoap.php file (included in the zip file) should be moved inside the flashservices/lib/ folder. This enables the amfphp serializer to pass the SOAP packet to and from the Google service. Another good way to get started is reading over the overview at AMFPHP on sourceforge.

In order to use Google services, each developer needs to have a google account and license key - this is required by google to use there service. You can obtain a free License Key and Google Account from: http://www.google.com/apis/. Then put the key at the very beginning of the first frame in layer "code" (line 6) of the googleLinks.fla.

Again, if you find all this too difficult, first read the Hello World Remoting tutorial as a starting point. there are many other tutorials on this site dealing with web services: Currency Converter, Language Translator and Floogle. You may also want to check out the web services directory to find additional services.

 

Additional Information:

If you download the zip file: GoogleLinks.html, googleLinks.swf, gateway.php and RegExp.as are located in the main folder. google.php (Remoting class) and GoogleSearch.php (Google search class) are located in the services folder. You need to move nusoap.php to the flashservices/lib/ folder. If you don't have the lib folder inside flashservices, create it. We will try to keep this file updated with the latest working version.

In the movie the googleSearch class use's the following methods:

- init: set default Gateway and initialize variables
- setSearchTerm/getSearchTerm: sets and retrieves the search term
- setLastProp/getLastProp: add a unique URL to the request array
- showData: shows info about the URL when the "Show info on Press" checkbox is set to true
- showLoading: shows query advance
- search: initiates the query
- extract: filtering of repeated URL's using regular expressions
- createDot: creates dots (display of a URL)
- drawline: call methods to create dots and connect it
- connectdot: draw lines between dots

If you want to show a default search at the beginning, uncomment the last line in the code layer (at the very end of the code in the first frame). You can also hide the search features and only display links to your own site.

Acknowledgements

Jeff Hill, for all the examples about using Web services with Flash
Pavils Jurjans, for his RegExp flash class (http://www.jurjans.lv/flash/RegExp.html)
Vijay Immanuel, for his GoogleSearch php class (http://vijay.staghosting.com)
Ram Prass, for his dot example, starting point for connecting dots

As you can see, this is more of a collective effort than a personal one.

 

 Download the LinkToMe Source Files
- be sure to check the message board for updates.