[Flashr] get username
Spiros Gerokostas
sger_error at hotmail.com
Tue Apr 18 08:07:41 EDT 2006
this is my code:
//code
_flickrResponseListener.onPhotosGetInfo = function (p)
{
arr_title.push(p.title);
arr_taken.push(p._dateTaken);
arr_owner.push(p.owner.username);
arr_desc.push(p.description);
};
//
function getImages() {
var _flickrResponseListener = new
com.kelvinluck.flickr.FlickrResponseListener();
_flickr.photosSearch({tags:tag, extras:"owner_name", per_page:imageNumber,
page:1});
_flickrResponseListener.onPhotosSearch = function(photos:Array,
resultsSet:ResultsSet) {
//trace("onPhotosSearch - "+resultsSet.total+" results, viewing page
"+resultsSet.page+" of "+resultsSet.numberOfPages+" also results pre page
"+resultsSet.resultsPerPage);
arr_large = [];
arr_thumbs = [];
arr_title = [];
arr_id = [];
arr_owner = [];
arr_pageUrl = [];
arr_dateTaken = [];
arr_photosFirstDate = [];
total = resultsSet.photos.length;
for (i=0; i<total; i++) {
arr_thumbs.push(photos[i].thumbnailUrl);
arr_large.push(photos[i].mediumUrl);
arr_title.push(photos[i].title);
arr_id.push(photos[i].id);
arr_owner.push(photos[i].owner.username);
arr_photosFirstDate.push(photos[i].owner.photosFirstDate);
arr_desc.push(photos[i].description);
arr_pageUrl.push(photos[i].photoPageUrl);
arr_dateTaken.push(photos[i]._dateTaken);
//trace("owner: "+photos[i].owner);
trace("photo posted by: "+photos[i].owner.username);
//trace("photosFirstDate: "+photos[i].owner.photosFirstDate);
//trace("nsid: "+photos[i].owner.nsid);
trace("id: "+photos[i].id);
//trace("title: "+photos[i].title);
//trace("photoPageUrl: "+photos[i].photoPageUrl);
trace("desc :"+arr_desc);
trace("secret :"+photos[i].secret);
//trace("_dateTaken :"+photos[i]._dateTaken);
_flickr.photosGetInfo(arr_desc[i]);
}
};
}
//end code
i want to do 2 things:
first trace the "description, _dateTaken, photosFirstDate" and second trace
the tags for a photo ID (photos[i].id)
Any help?
>From: Kelvin Luck <kelvin at kelvinluck.com>
>Reply-To: kelvin at kelvinluck.com, Flashr at osflash.org
>To: Flashr at osflash.org
>Subject: Re: [Flashr] get username
>Date: Mon, 17 Apr 2006 13:53:48 +0100
>
>Spiros Gerokostas wrote:
> > ok thanks again kelvin (must read the whole documentation!!!)
> >
> > another example is
> >
> > trace("realname: " + photos[i].owner.realname);
> >
> > but returns undefined why?
>
>The realname isn't available until you have made an API call which
>returns it. At the moment all you know is the id and username for the
>user because that is all that is returned by your call to photosSearch.
>
>To see what information each call returns you can use flickr.com's API
>Explorer (e.g.
>http://www.flickr.com/services/api/explore/?method=flickr.photos.search
> or http://www.flickr.com/services/api/ for a list of all methods).
>
>So to find out the real name of the user you would need to call
>peopleGetInfo with the user id (e.g. photos[i].owner.nsid) and wait for
>the relevant onPeopleGetInfo response...
>
>Hope this helps,
>
>Kelvin :)
>
>_______________________________________________
>Flashr mailing list
>Flashr at osflash.org
>http://osflash.org/mailman/listinfo/flashr_osflash.org
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
More information about the Flashr
mailing list