Flickr AS3:加载照片
我已经能够弄清楚如何使用 Adobe Lib 调用 Flickr API 并获得响应...我可以获得描述、id 等。但现在我正在尝试弄清楚如何在实际中加载照片并将其添加到舞台上。
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);
}
}
我开始认为,为了获取实际照片,我需要通过 URLRequest 来获取它。但这不是任何其他教程的做法...或者也许他们是...
我遗漏了某些部分...有人可以帮助我吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我花了大约 30 分钟使用 Adobe 的官方 Flickr API,然后就把它扔掉了。从我所看到的来看,我敢说这是我接触过的最不可用的图书馆。我强烈建议您使用以下优秀文档通过简单的 URLRequests 使用 REST API:
http://www.flickr.com/services/api/
至于你的问题,你需要使用每个照片节点中发送的信息将图像 URL 组合在一起,如下所述: 照片来源网址
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