Accessing Flickr Video

6 views
Skip to first unread message

jassa

unread,
Jan 7, 2009, 8:26:34 PM1/7/09
to ActionScript 3 Flickr Library
Is it possible to access flickr video via the as3flickrlib? And if
not, are the any plans to add that functionality in the future? Come
to think of it, does the Flickr API even allow it at this stage??

Jassa

Jesse Morrison

unread,
Jan 7, 2009, 8:44:57 PM1/7/09
to as3fli...@googlegroups.com
Hrm. Methinks that would be cool.

Jesse

Jesse Morrison

unread,
Jan 9, 2009, 12:25:17 PM1/9/09
to as3fli...@googlegroups.com, Jassa Amir-Lang
Hi

I'm trying to switch my app over from using the entire stream to using a
specific set of photos. The bulk of my code requires a PagedPhotoSet,
but I don't seem to be able to get that using the following code:

//----------------------------------------------------SEARCH FOR
SETS

//Search for photo SETS using user id
private function findUserSets():void{
this._fs.photosets.getList(USERID);

this._fs.addEventListener(FlickrResultEvent.PHOTOSETS_GET_LIST, setsFound);
}

//event handler for PHOTOSETS_GET_LIST
private function setsFound(e:FlickrResultEvent):void {
trace("setsFound");

var sets:Array = e.data.photoSets as Array;
var firstSet:PhotoSet = sets[0] as PhotoSet;

this._photoList = firstSet.photos as PagedPhotoList;
//************problem? the photos property seems to have no
length***************

//store total number of photos in list for looping later
this._numPhotos = firstSet.photoCount;

//add tiles to target
this.addThumbs();
}

Jesse Morrison

unread,
Jan 9, 2009, 1:50:17 PM1/9/09
to as3fli...@googlegroups.com, Jassa Amir-Lang
OK, I think I solved my problem :-]

I believe this is the flow of events for working with PhotoSets and the
photos contained therein:

-get frob
-get list of user's sets by passing user ID to search
-choose desired set from returned list
-get photos for that set
-work with returned PhotoSet, which finally contains the actual Photo
objects

Here's the code to get through the above steps (please excuse redundant
code, as this was patched together):

public function Gallery() {

//Allow flickr domain, so we can do all the bitmapdata stuff
Security.allowDomain(FLICKR_URL);
Security.loadPolicyFile(CROSSDOMAIN_URL);

//Initialise FlikrService with the API key
this._fs = new FlickrService(API);
this._fs.secret = SECRET;

//Get that frob!
this._fs.auth.getFrob();

//Listen for the response of the event - Error listeners can
be put for monitoring errors
this._fs.addEventListener(FlickrResultEvent.AUTH_GET_FROB,
gotFrob, false, 0, true);
}

//---------------------------------GOT FROB

//event handler for AUTH_GET_FROB
private function gotFrob(evt:FlickrResultEvent):void {
if (evt.success) {
//trace("frob acquired");
findUserSets();


}
}

//----------------------------------------------------SEARCH FOR
SETS

//Search for photo SETS using user id
private function findUserSets():void{
this._fs.photosets.getList(USERID);

this._fs.addEventListener(FlickrResultEvent.PHOTOSETS_GET_LIST, setsFound);
}

//event handler for PHOTOSETS_GET_LIST
private function setsFound(e:FlickrResultEvent):void {

//trace("setsFound");



var sets:Array = e.data.photoSets as Array;
var firstSet:PhotoSet = sets[0] as PhotoSet;

//get list of Photos in set
this._fs.photosets.getPhotos(firstSet.id);

this._fs.addEventListener(FlickrResultEvent.PHOTOSETS_GET_PHOTOS,
gotPhotos);
}

//event handler for PHOTOSETS_GET_PHOTOS
private function gotPhotos(e:FlickrResultEvent):void {
//trace("gotPhotos");



//store total number of photos in list for looping later

this._photoList = e.data.photoSet as PhotoSet;
this._numPhotos = this._photoList.photos.length;

//DO SOMETHING COOL
}

bobbyworld

unread,
Jan 9, 2009, 7:25:22 PM1/9/09
to ActionScript 3 Flickr Library
Are you creating a Flex application or an AIR application? I'm
curious about the Allow.Security domain code part.

Thanks
Bobby

Jesse Morrison

unread,
Jan 9, 2009, 7:35:07 PM1/9/09
to as3fli...@googlegroups.com
This is a (gulp) straight-up Flash project. I need to start using Flex
and whatnot, but it's another part of the ever-expanding Flash world
that I haven't had time for yet.

Jesse
Reply all
Reply to author
Forward
0 new messages