Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 11-26-2008, 08:29 AM   #1
wickedboy
still a bit cheeky...
 
wickedboy's Avatar
 
Join Date: Feb 2005
Posts: 296
Default Google a Montage

Any idea how this could be done in Flash?

Google a Montage
__________________
And then she said to the boy: "You are such a wicked, wicked boy!"
wickedboy is offline   Reply With Quote
Old 11-26-2008, 08:57 AM   #2
Paul Ferrie
Scottish and mad fer it!!
 
Paul Ferrie's Avatar
 
Join Date: Jun 2002
Location: uk/scotland/glasgow
Posts: 3,606
Default

Quote:
Originally Posted by wickedboy View Post
Any idea how this could be done in Flash?

Google a Montage
That's pretty cool
__________________
.:To me AS is like LEGO, Only for the big Kids :.
- InnovativeDesigns - Scotflash - About me
Paul Ferrie is offline   Reply With Quote
Old 11-26-2008, 11:57 AM   #3
3pepe3
;)
 
3pepe3's Avatar
 
Join Date: Aug 2006
Location: In transit--- Still bored
Posts: 1,739
Default

This looks preaty nice.
I don't know if you can feed directly the images found by google but on PHP you can load the page and get what you want...
ex.
http://images.google.fr/images?um=1&...tionscript.org

Then read this as a String (or XML) and parse the desired data using some regular expresion (or node selection)...

So one of the nodes (or part of the string) will look like this:

<a href="/imgres?imgurl=http://images.sixrevisions.com/2008/07/10-06_actionscript_dot_org.jpg&amp;imgrefurl=http://sixrevisions.com/flashactionscript/flash_tutorial_websites/&amp;usg=__9OBSVZhMegx2sPy-PakmDmgv1fU=&amp;h=200&amp;w=550&amp;sz=28&amp;hl= en&amp;start=3&amp;um=1&amp;tbnid=K476T13K3YhQgM:& amp;tbnh=48&amp;tbnw=133&amp;prev=/images%3Fq%3Dactionscript.org%26um%3D1%26hl%3Den%2 6client%3Dfirefox-a%26rls%3Dorg.mozilla:frfficial"><img style="border: 1px solid ;" src="http://tbn2.google.com/images?q=tbn:K476T13K3YhQgM:http://images.sixrevisions.com/2008/07/10-06_actionscript_dot_org.jpg" width="133" height="48"></a>

So then that you found the desired information (http://images.sixrevisions.com/2008/...pt_dot_org.jpg) you will build your own XML, JSON or string file to be send into flash.
Also you can load all this data directly on flash and parse everything when onData occurs.
Well this is just an idea...
__________________
http://www.pepemagana.com
3pepe3 is offline   Reply With Quote
Old 11-26-2008, 12:02 PM   #4
Paul Ferrie
Scottish and mad fer it!!
 
Paul Ferrie's Avatar
 
Join Date: Jun 2002
Location: uk/scotland/glasgow
Posts: 3,606
Default

i would say that was pretty damn close!
well done.
__________________
.:To me AS is like LEGO, Only for the big Kids :.
- InnovativeDesigns - Scotflash - About me
Paul Ferrie is offline   Reply With Quote
Old 11-26-2008, 12:25 PM   #5
wickedboy
still a bit cheeky...
 
wickedboy's Avatar
 
Join Date: Feb 2005
Posts: 296
Default

Thank you both! Wow so it is possible then... Paul you know, don't you !
Go on, what's the secret?

wB
__________________
And then she said to the boy: "You are such a wicked, wicked boy!"
wickedboy is offline   Reply With Quote
Old 11-26-2008, 12:48 PM   #6
asf8
Senior Member
 
Join Date: Apr 2007
Posts: 4,772
Default

Quote:
Originally Posted by wickedboy View Post
...Wow so it is possible then...
Well since the link you posted works, of course its possible

You will have to get intimate with the Google API.
http://code.google.com/apis/ajaxsearch/documentation/

Flash and other Non-Javascript Environments (AS3 example code)
http://code.google.com/apis/ajaxsear...ntation/#fonje

I have read Yahoo's API is easier, but that was some time ago (3+ years) but I read it output cleaner XML.
Its hard to say which is easy/best now.
http://developer.yahoo.com/search/index.html
http://developer.yahoo.com/flash/astra-webapis/

You will have to pick an API and go from there.

Quote:
Originally Posted by wickedboy View Post
... Paul you know, don't you... Go on, what's the secret?
Secret = Lots of learning and determination + mucho testing

----------
Hi 3pepe3, long time no see. Hope your doing well, good to see you.
asf8 is offline   Reply With Quote
Old 11-26-2008, 05:53 PM   #7
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 26,666
Default

Welcome back, 3pepe3...

I'm bored...
ActionScript Code:
// function loadGoogleImage(_s:String):Void { //  trace("Function loadGoogleImage : _s = " + _s);     var searchURL:String = "http://images.google.com/images";     var _lv:LoadVars = new LoadVars();     _lv.q = _s;     _lv.onLoad = function () {}     _lv.onData = function (raw)     {         parseData(raw);     }     _lv.sendAndLoad(searchURL, _lv, "GET"); } function parseData(_d:String):Void { //  trace("Function parseData");     var idxS:Number = -1;     var idxE:Number = -1;     var u:String = "";         idxS = _d.indexOf("<a href=/imgres?imgurl=") + 23;     for (var i:Number = idxS ; i < _d.length ; i++)     {         if (i > idxS)         {             loadImages();             break;         }                 idxS = _d.indexOf("<img src=", idxS) + 9;         idxE = _d.indexOf(" ", idxS);         u = _d.substr(idxS, idxE - idxS);                 if (u.substr(0, 4) == "http")         {             trace(idxS + " : " + idxE + " : " + u);             img_arr.push(u);         }     } } function loadImages():Void {     trace("Function loadImages : Do your loading stuff..."); } var img_arr:Array = new Array(); var searchTerm:String = "flash"; loadGoogleImage(searchTerm);
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer
http://CyanBlue.FlashVacuum.com
http://www.FlashVacuum.com
http://tutorials.FlashVacuum.com

Do NOT PM, Email or Call me... Your question belongs right in this forum...
CyanBlue is offline   Reply With Quote
Old 11-26-2008, 06:20 PM   #8
asf8
Senior Member
 
Join Date: Apr 2007
Posts: 4,772
Default

Wow, cool stuff CyanBlue! Impressive boredom output indeed. That is some interesting code to digest. [Q] Which part limits the number of items returned? Looking forward to see what else you come up with if you remain bored ;-) Thanks for sharing.
asf8 is offline   Reply With Quote
Old 11-26-2008, 06:25 PM   #9
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 26,666
Default

Well... Google Image spits up 20 images per page, so that's where your limit is... I am only storing all the external urls to an array... You can do whatever you want with the img_arr once it is populated...
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer
http://CyanBlue.FlashVacuum.com
http://www.FlashVacuum.com
http://tutorials.FlashVacuum.com

Do NOT PM, Email or Call me... Your question belongs right in this forum...
CyanBlue is offline   Reply With Quote
Old 11-26-2008, 06:45 PM   #10
asf8
Senior Member
 
Join Date: Apr 2007
Posts: 4,772
Default

Quote:
Originally Posted by CyanBlue View Post
Well... Google Image spits up 20 images per page, so that's where your limit is... I am only storing all the external urls to an array... You can do whatever you want with the img_arr once it is populated...
The array part I got. But I couldnt figure where you were setting the number of images.... but now that you mention 20, D'oh, I see ;-) Wonder using your setup if there is a way to get around that to load more than 20 unique returns... hmmm

Again thanks for sharing thats great stuff CyanBlue.
asf8 is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Google SEO and Flash goliatone HTML and JavaScript 5 04-16-2009 10:38 PM
Help with google map in AS3 EddaRós ActionScript 3.0 0 11-01-2008 09:15 PM
Google Chrome Browser and flash Madsny General Chat 4 09-16-2008 05:36 PM
Experimental Google Earth Chat bowljoman Site Check 3 08-11-2008 05:27 AM
Flash in search engines Bal ActionScript 1.0 (and below) 26 01-11-2006 12:52 AM


All times are GMT. The time now is 05:41 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.