In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

forked from: Google AJAX Search APIを使ってみる

Google AJAX Search APIを使ってみる!
こんな感じであってる?
Get Adobe Flash player
by hacker_yi5_jmyd 06 Mar 2010
    Embed
// forked from paq's Google AJAX Search APIを使ってみる
//
//Google AJAX Search APIを使ってみる!
//こんな感じであってる?
//
package {
	import flash.display.*;
	import flash.events.*;
	import flash.xml.*;
	import flash.net.*;
	import flash.text.*;
	import flash.utils.escapeMultiByte;
	import com.adobe.serialization.json.*;
	
	public class Main extends MovieClip{
		private var loader:URLLoader = new URLLoader();
		
		public function Main():void {
    Wonderfl.capture(stage);
			loader.load(new URLRequest("http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q="+escapeMultiByte("kardashian")+"&rsz=large"));
			loader.addEventListener(Event.COMPLETE,loadComplete);
		}
		private function loadComplete(e:Event):void {
			var json:Object = JSON.decode(e.target.data as String);
                        var tf:TextField = new TextField();
                        tf.width = 465; tf.height = 465
                        addChild(tf);
                        for(var i:uint = 0; i < 8; i++){
                            tf.text = tf.text + json.responseData.results[i].titleNoFormatting + "\n" +json.responseData.results[i].unescapedUrl + "\n\n";
                        }
		}
	}
}