My favorites | Sign in
Logo
                

Google Web APIs - Actionscript 3 library (v2.1)

When you find bugs or errors, please fill in an issue (under 'Issues'-tab)

About

The library is a simple collection of Google's API features, there is a class per feature, like Google Web search, Images Search, Google Suggest etc. Each library throws it’s own event with an Array or Value Object of matching datatype(s), for example GoogleWebItem, so it’s easy to keep track on wich data is recieved and what this data contains, giving the developer transparency using Intellisense.

Contains

This api contains:

Compatibility

This API is Flash & Flex compatible using Actionscript 3 (FP9 & 10).

Documentation

You can find the documentation under downloads > documentation. It's also archived in the downloadable source-zip (under the docs directory) and can also be found under the docs folder in the trunk of the SVN.

Little example code

var googleWebSearch:GoogleWebSearch=new GoogleWebSearch();
googleWebSearch.search(txtInput.text,0,"nl");
googleWebSearch.addEventListener(GoogleApiEvent.WEB_SEARCH_RESULT,onWebResults) ;

//If you want to catch the API errors yourself:
googleWebSearch.addEventListener(GoogleAPIErrorEvent.API_ERROR,onAPIError)

private function onWebResults(e:GoogleApiEvent):void{
	var resultObject:GoogleSearchResult=e.data as GoogleSearchResult
	trace("Estimated Number of Results: "+resultObject.estimatedNumResults)
	trace("Current page index: "+resultObject.currentPageIndex)
	trace("Number of pages: "+resultObject.numPages)

	for each (var result:GoogleWebItem in resultObject.results){
		trace(result.title, result.url)
	}
}

private function onAPIError(evt:GoogleAPIErrorEvent):void{
	trace("An API error has occured: " + evt.responseDetails, "responseStatus was: " + evt.responseStatus);
}

Dependencies

This library uses certain classes (for example JSON-decoding), found in the AS3CoreLib by Mike Chambers, Daniel Dura and Christian Cantrell. These classes can be checked out or downloaded here: http://code.google.com/p/as3corelib

Versions

If possible, checkout the latest source via SVN. SVN Clients I would recommend:

Latest changelog

Changelog 2.0.2 to 2.1









Powered by Google Project Hosting