(1.2.0.1)Picasaの検索結果を確認(JSON)

by umhr forked from (1.2)Picasaの検索結果を確認(JSON) (diff: 8)
Picasa Web Albums Data API
* http://code.google.com/intl/ja/apis/picasaweb/docs/2.0/reference.html
* 参考
* http://wonderfl.net/code/95d18286b23549ece13d4933dffd64a6cf550386
* 
♥0 | Line 36 | Modified 2009-09-10 20:57:00 | MIT License
play

ActionScript3 source code

/**
 * Copyright umhr ( http://wonderfl.net/user/umhr )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/aGxC
 */

/*
 * Picasa Web Albums Data API
 * http://code.google.com/intl/ja/apis/picasaweb/docs/2.0/reference.html
 * 参考
 * http://wonderfl.net/code/95d18286b23549ece13d4933dffd64a6cf550386
 * 
*/
package {
	import flash.display.Sprite;
	import flash.text.TextField;
	import flash.text.TextFieldAutoSize;
	import flash.filters.DropShadowFilter;
	
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.display.Loader;
	import flash.events.Event;
	import flash.net.URLLoader;
	import flash.net.URLRequest;
	import flash.system.LoaderContext;
	import flash.system.Security;
	import com.adobe.serialization.json.JSONDecoder;
	public class Main extends Sprite{
		public function Main() {
			Security.loadPolicyFile("http://photos.googleapis.com/data/crossdomain.xml");
			var myURLLoader:URLLoader = new URLLoader();
			myURLLoader.addEventListener(Event.COMPLETE, onCompleteRSS);
			var URLstr:String = "http://photos.googleapis.com/data/feed/base/all?alt=json&kind=photo&access=public&filter=1&q=waterdrop&isvideo=false&imglic=commercial&max-results=3&imgmax=288";
			myURLLoader.load(new URLRequest(URLstr));
		}
		
		private function onCompleteRSS(e:Event):void {
			var decoder:JSONDecoder = new JSONDecoder(e.currentTarget.data);
            var json:Object = decoder.getValue();
			var textData:String = json.toString();
			var tf:TextField = new TextField();
			
			textData += "\n******\n";
			textData += e.currentTarget.data;
			
			tf.text = textData;
			tf.wordWrap = true;
			tf.width = tf.height = 465;
			addChild(tf);
		}
	}
}

Forked