Forum Games Google Custom Search API in Flash?

Discussion relating to game development with Flash

Google Custom Search API in Flash?

Postby bohdan » August 7th, 2011, 11:21 pm

Hi everyone,

Does anyone have any experience using the Google Custom Search API in Flash? I'm wondering if I could make a google image search within my game, and use the results to put thumbnail images into my game. Anyone know anything about that? I'm not even sure if the Google Custom Search API supports image searches.

Thanks a ton,

Bo
bohdan
 
Posts: 30
Joined: June 24th, 2011, 8:18 am

Re: Google Custom Search API in Flash?

Postby ZEGMAN » May 16th, 2012, 6:22 am

I don't think so.
But you could pass the word they are searching for into the parameter for google image search and parse the page your self with:

Code: Select all
var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.BINARY;
loader.addEventListener(Event.COMPLETE, moduleLoadedCompleteHandler);
loader.addEventListener(IOErrorEvent.IO_ERROR, moduleLoaderErrorHandler);
loader.load(new URLRequest("http://google.com/"));

function moduleLoadedCompleteHandler(e:Event): void {
    var loader:URLLoader = URLLoader(e.target);
    var data:ByteArray = ByteArray(loader.data);
    trace(data);
}

function moduleLoaderErrorHandler(e:Event): void {
   
}
ZEGMAN
 
Posts: 1
Joined: May 16th, 2012, 6:12 am


Return to Games



cron