开发者

Flickr AS3: Loading in a photo

I've been able to figure out 开发者_如何学编程how to call the Flickr API with the Adobe Lib and get a response... I can get the description, id, etc. But now I'm trying to figure out how to load in the actual photo and add it to the stage.

function loadStartingPhoto():void
{
    service.addEventListener(FlickrResultEvent.PHOTOS_GET_INFO, handlePhotoGetInfo);
    var photo:Photos = new Photos(service);
    photo.getInfo("PHOTOID", "SECRET");
}

function handlePhotoGetInfo(e:FlickrResultEvent):void
{
    if (e.success)
    {
        trace(e.data);
        var photo:Photo = new Photo();
        photo = e.data.photo;
        this.photoContainer.addChild(photo);
    }
}

I'm starting to think that in order to pull in the actual photo, I need to get it by way of a URLRequest. But that's not how any of the other tutorials are doing it... or maybe they are...

I'm missing some part... can someone help me out?


I spent like 30 minutes with Adobe's official Flickr API and threw it away. From the glimpse I got, I would dare to say its the most unusable library I've ever touched. I strongly recommend you to use the REST API through simple URLRequests using this great documentation: http://www.flickr.com/services/api/

As for your question, you need to put together the image URL using the info sent in every photo node, as explained here: Photo Source URLs

http://farm{farm-id}.static.flickr.com/{server-id}/{id}_{o-secret}_o.(jpg|gif|png)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜