|
Project Information
Featured
Downloads
Links
|
Google Web APIs - Actionscript 3 library (v2.1)When you find bugs or errors, please fill in an issue (under 'Issues'-tab) AboutThe 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. ContainsThis api contains:
CompatibilityThis API is Flash & Flex compatible using Actionscript 3 (FP9 & 10). DocumentationYou 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 codevar 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);
}DependenciesThis 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 VersionsIf possible, checkout the latest source via SVN. SVN Clients I would recommend:
Latest changelogChangelog 2.0.2 to 2.1
|