forked from: Yahoo!Pipes(xml)
forked from Yahoo!Pipes(xml) (diff: 44)
http://pipes.yahoo.com/pipes/pipe.info?_id=bd89377e6444cfe6083bad4904c60b79
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/yiUo
*/
// forked from umhr's Yahoo!Pipes(xml)
/*
http://pipes.yahoo.com/pipes/pipe.info?_id=bd89377e6444cfe6083bad4904c60b79
*/
package {
import flash.display.Sprite;
import flash.text.TextField;
import flash.display.Loader;
import flash.events.Event;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.filters.DropShadowFilter;
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.system.LoaderContext;
public class Main extends Sprite{
public function Main() {
var myURLLoader:URLLoader = new URLLoader();
myURLLoader.addEventListener(Event.COMPLETE, onComplete);
var URLstr:String = "http://pipes.yahooapis.com/pipes/pipe.run?_id=f4f6c98189a88373b9bfd4fe6128c018&_render=rss&url=";
//URLstr += "http://ax.itunes.apple.com/WebObjects/MZStoreServices.woa/ws/RSS/topalbums/sf=143441/limit=4/explicit=true/xml";
URLstr += encodeURIComponent("http://picasaweb.google.com/data/feed/base/all?alt=rss&kind=photo&access=public&filter=1&q=waterdrop&isvideo=false&imglic=commercial&max-results=3");
//URLstr +="http%3A%2F%2Fpicasaweb.google.com%2Fdata%2Ffeed%2Fbase%2Fall%3Falt%3Drss%26kind%3Dphoto%26access%3Dpublic%26filter%3D1%26q%3Dwaterdrop%26isvideo%3Dfalse%26imglic%3Dcommercial%26max-results%3D3";
myURLLoader.load(new URLRequest(URLstr));
}
private function onComplete(e:Event):void {
var myXML:XML = new XML(e.currentTarget.data);
default xml namespace = new Namespace("http://search.yahoo.com/mrss/");
var tf:TextField = new TextField();
tf.text = myXML.channel.item.length();
tf.appendText(myXML.channel.item[0]. author);
tf.appendText(myXML.channel.item[0].title);
tf.appendText(myXML.channel.item[0].link);
tf.appendText("***");
tf.appendText(myXML.channel.item[0].group.thumbnail.length())
tf.appendText("***");
tf.appendText(myXML.channel.item[0].group.thumbnail[0].@url);
tf.appendText("***");
tf.appendText(myXML.channel.item[0]);
tf.wordWrap = true;
tf.width = tf.height = 465;
addChild(tf);
var myLoader:Loader = new Loader();
myLoader.load(new URLRequest(myXML.channel.item[0].group.thumbnail[1].@url), new LoaderContext(true));
myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteImg);
//addChild(myLoader);
}
private function onCompleteImg(e:Event):void {
var bitmap:Bitmap = e.target.content;
var myBitmapData:BitmapData = new BitmapData(bitmap.width, bitmap.height);
myBitmapData.draw(bitmap);
var sp:Sprite = new Sprite();
sp.graphics.beginBitmapFill (myBitmapData);
sp.graphics.drawRoundRect( 50, 50 , 365, 365, 100, 100);
sp.graphics.drawCircle(465/2, 465/2, 100);
sp.graphics.drawCircle(465/2, 465/2, 80);
sp.filters = [new DropShadowFilter()];
addChild(sp);
}
}
}
