List Info

Thread: tag search results in slideshow




tag search results in slideshow
user name
2007-02-02 11:15:13
Hi, Kevin/ other experts:

I'd like to build an extended application based on your simple tag search example.
The temporal goal is to show, say 500 photos of specific tag from Flickr, with each photo showing 5 seconds on the screen.

The first problem is it seems that sometimes(?) those requested results are the same.
For example, when I call _flashr.photosSearch({tags:dog, per_page:10})  50 times, with requesting 10 photos each time,
the 10 photos returned remain the same in different runs. How could I prevent this situation?
Because I want to show different photos over time, not repeating the same photos.
If I request all 500 photos and save those in a local array in Flash, then it may be too heavy for Flash? (I request normal size photos, not just thumbnails)

The second question is how to make a photo staying shown for 5 seconds and then move onto the next one?
I have tried to use the following code (in this example, I only request one photo each time and there are 4 requests in total)
function onPhotosSearch(rs:ResultsSet)
    {
       var thisPhoto:Photo = rs.photos[0];
     ;  var show_interval:Number = setInterval(showImage, 5000, thisPhoto); //showing the current photo for 5 seconds
  ; &nbsp; &nbsp; &nbsp; &nbsp; if (_numRequests < 4)
 &nbsp;   &nbsp;   &nbsp;  { &nbsp;   &nbsp;   &nbsp;   &nbsp;  doSearch(SEARCH_TAG);  ;  //searching for next photo
&nbsp; &nbsp;  &nbsp;   &nbsp;  }
 &nbsp;   &nbsp;   &nbsp;  else
 ; &nbsp;  &nbsp;   &nbsp;  {
 &nbsp;   &nbsp;   &nbsp;   &nbsp; 
 &nbsp;   &nbsp;   &nbsp;   &nbsp;  trace(&quot;n Requesting number is out of limit";);
 ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp;  clearInterval(show_interval);&nbsp; &nbsp;  &nbsp;   &nbsp;   &nbsp; 
 &nbsp;   &nbsp;   &nbsp;  }
 &nbsp; }
 I knew something is wrong because it didnot work the way I want, but I don't know how to fix it.
I realized that I passed the same "thisPhoto" in setInterval(), so in every 5 seconds it shows the same photo.
(for now I only know 2 approaches to show something for certain duration- onEnterFrame and setInterval )
So, the question will be is it possible to pass a dynamic variable to setInterval()?
Or I am in the wrong direction to make those photos shown in slideshow presentation?
(Maybe using some for-loop to read a photo from an arrary each 5 seconds, but the question remains the same-
how to let some action stays for certain duration?)

Please guide me a way. Thanks a lot.

Gloria
Re: tag search results in slideshow
user name
2007-02-02 11:38:50
Hi Gloria,

I just posted source for connecting a flash slide show to flickr...

http://www.forestandthetrees.com/mashupTalk/mashupCodeExample/index.htm

Take a look at the FlickrPhotoGetter class. and the getPhotosByTag method.

The source should basically do what you want.

Good luck

Doug

On 2/2/07, gloria kao < gloriakaogmail.com">gloriakaogmail.com> wrote:
Hi, Kevin/ other experts:

I'd like to build an extended application based on your simple tag search example.
The temporal goal is to show, say 500 photos of specific tag from Flickr, with each photo showing 5 seconds on the screen.

The first problem is it seems that sometimes(?) those requested results are the same.
For example, when I call _flashr.photosSearch({tags:dog, per_page:10})  50 times, with requesting 10 photos each time,
the 10 photos returned remain the same in different runs. How could I prevent this situation?
Because I want to show different photos over time, not repeating the same photos.
If I request all 500 photos and save those in a local array in Flash, then it may be too heavy for Flash? (I request normal size photos, not just thumbnails)

The second question is how to make a photo staying shown for 5 seconds and then move onto the next one?
I have tried to use the following code (in this example, I only request one photo each time and there are 4 requests in total)
function onPhotosSearch(rs:ResultsSet)
&nbsp; &nbsp; {
 &nbsp;   &nbsp; var thisPhoto:Photo = rs.photos[0];
 &nbsp;   ;  var show_interval:Number = setInterval(showImage, 5000, thisPhoto); //showing the current photo for 5 seconds
 &nbsp; &nbsp; &nbsp;   ;  if (_numRequests < 4)
 &nbsp;   &nbsp;   &nbsp;  { &nbsp;   &nbsp;   &nbsp;   &nbsp;  doSearch(SEARCH_TAG);  ;  //searching for next photo
&nbsp; &nbsp;  &nbsp;   &nbsp;  }
 &nbsp;   &nbsp;   &nbsp;  else
 ; &nbsp;  &nbsp;   &nbsp;  {
 &nbsp;   &nbsp;   &nbsp;   &nbsp; 
 &nbsp;   &nbsp;   &nbsp;   &nbsp;  trace(&quot;n Requesting number is out of limit";);
 ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp;  clearInterval(show_interval);&nbsp; &nbsp;  &nbsp;   &nbsp;   &nbsp; 
 &nbsp;   &nbsp;   &nbsp;  }
 &nbsp; }
 I knew something is wrong because it didnot work the way I want, but I don't know how to fix it.
I realized that I passed the same "thisPhoto" in setInterval(), so in every 5 seconds it shows the same photo.
(for now I only know 2 approaches to show something for certain duration- onEnterFrame and setInterval )
So, the question will be is it possible to pass a dynamic variable to setInterval()?
Or I am in the wrong direction to make those photos shown in slideshow presentation?
(Maybe using some for-loop to read a photo from an arrary each 5 seconds, but the question remains the same-
how to let some action stays for certain duration?)

Please guide me a way. Thanks a lot.

Gloria

_______________________________________________
Flashr mailing list
osflash.org">Flashrosflash.org
http://osflash.org/mailman/listinfo/flashr_osflash.org


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )