Continuous scrolling image thumbnail and slideshow component for Flex.

I've been working on improvements for this thumbnail/slideshow component. The way the continuous scroll flows is very nice. It provides a very fluid feel. I have it reading XML from SlideShowPro director. SSPD simply gives a structure of albums and images, so the component should work from essentially any XML source as long as it follows the same schema:

<gallery>
     <album id="0" description="DESCRIPTION" title="TITLE" tn="PATH" lgpath="PATH" tnpath="PATH">
          <img src="FILENAME" />
          ...
     </album>
</gallery>

There is still a good bit of work to do. Right now the slideshow is coupled with the thumbnail container. I think that should be seperated, because I can see various uses for thumbnails outside of a slideshow. It needs style and event metadata so that it will function as a proper Flex component. I am also going to roll it into mediated PureMVC components for inclusion in VE:Session.

The source is here.

21 Responses to “Continuous scrolling image thumbnail and slideshow component for Flex.”


  1. 1 Matt Platte

    I’m kinda interested in the Flex component but I am spellbound by the photos. I watched the show once and will probably go through the entire set again, after posting this. If they’re your photos, perhaps you should forget about Flex and take more pictures… ;)

  2. 2 Joel

    Matt,

    Thanks! The photos are from our photography studio. I am developing a client ordering/viewing/management application. This is a component of a broader application.

  3. 3 John

    nice job..

    but i can’t find xml file. where is it. i downloaded source but it oesn’t work. ı have an error about TweenLite. please help..

  4. 4 Joel

    John,

    I didn’t include the TweenLite classes. Let me update it. The XML is loaded dynamically from our gallery management software, SlideShowPro Director. Unfortunately, the developer of SSPD has removed this capability from the current version, but I am using an oleder version to achieve this. You can still hack the PHP of the current version, but I’m sure that violates his license. At some point I will be creating gallery management components as well. For now I suggest writing your own XML following the schema structure I outlined above.

    Thumbnails need to be 85×85. It is hard coded. I plan on making this variable in the future.

  5. 5 jet chen

    hello,how do add this function of Keyboard Control, Next and Previous?

  6. 6 jet chen

    hello, this function of Keyboard Control, Next and Previous has completed?

  7. 7 a_liang

    hello, thanks for your component, it is great . i creat

    well, slideshow working
    but there are large pictures that 800×600 . it can work. but can not display whole of the picture. please help me!

  8. 8 Joel

    I’ve updated this component to utilize keypress (left and right) for navigation.

    @a_liang -> If you set the image in changeImage() to:

    image.percentWidth = 100; image.percentHeight = 100;

    it should handle images of various sizes.

  9. 9 jet chen

    hehe,very good! thank you , Joel !

  10. 10 a_liang

    thanks, chen! it can work.

  11. 11 Joel

    I hope it works out for you guys. Let me know if you’d like to see any additional features. It works now for my needs, but I am happy to update for others as time permits.

  12. 12 Tim

    Hello Joel,

    This component is freaking awesome!!! I’ve spent the past few hours today, and various other days trying to get it to work. I am using Flex 2. I created a new project with my canvas, added the component and class files keep the same directory structure of your component and assets.

    Am I forgetting something?

    I get Error:1046, Type was not found or was not a compile time contstant. This is in the ImageScroll.mxml file. These 4 errors all are on the same pieces of code below.

    Thanks for any help!

    ———————————- [Embed(source=”assets/control_play_blue.png”)]
    [Bindable]
    private var playOnImgCls:Class

    [Embed(source=”assets/control_play.png”)]
    [Bindable]
    private var playOffImgCls:Class

    [Embed(source=”assets/control_stop_blue.png”)]
    [Bindable]
    private var stopOnImgCls:Class

    [Embed(source=”assets/control_stop.png”)]
    [Bindable]
    private var stopOffImgCls:Class

  13. 13 Joel

    Those files are the images I use for the slideshow buttons. They need to be in ../src/assets.

    Alternatively you could remove those embeds and delete the buttons.

  14. 14 Paul

    I tried plugging in the application and it looks great with the default image set, but for some reason when I have only a few images (I tried 1-3 images), the navigator goes crazy. The images continually push towards the right real fast and re-loop on the left to push right over again. Is there a certain image limit that must be maintained? Thanks :)!

  15. 15 Joel

    Hi Paul,

    I noticed this too. It didn’t come up in my tests because my image sets are generally big.

    I’m working on a real solution for this, right now it’s just a hack that I have for my use. I will let you know.

  16. 16 Marcin Dzaman

    Its great work I have small question if I want to load different gallery in same place how to do that. I want to make different galleries in different states or after clicking buttons I don’t know how to reset data so I have thumbnails above thumbnails those are transparent so its looks weird Thank you for help

  17. 17 Sriks

    I’m working on a real solution for this, right now it’s just a hack that I have for my use. I will let you know.

    Hi Joel, Paul

    Do you guys have any fix for this issue? My application has very few images to show.

    Thanks
    Sriks

  18. 18 Paul

    Hi Sriks,

    This is what Joel sent me via email for a fix to that issue. Message copied and pasted below:

    This is my fix for this. I’m not very happy with how it functions with under 20 or so images, so I will be updating with a real fix at some point in the near future. I will let you know.

            /**
             * Shifts the images to keep the continuous scroll continuous
             * @private
             */
            private function swap():void {
                alignThumbnails();
                var left:Thumbnail = _navArray[0];
                var right:Thumbnail = _navArray[_navArray.length-1];
    
                for (var i:int = 0; i<_navarray .length; i++) {
    
                    if (left.x<0-left.width && right != selectedItem) {
                        // moves clips from first to last
                        _navArray.push(_navArray.shift());
                        left.x = right.x+right.width;
                    }
    
                    if (right.x>totalWidth-right.width && right != selectedItem) {
                        // moves clips from last to first
                        _navArray.unshift(_navArray.pop());
                        right.x = left.x-right.width;
                    }
                }
            }
    
  1. 1 Flex做的连续滚动的相册缩略图组件(附源代码) - 全文检索博客
  2. 2 Flex做的连续滚动的相册缩略图组件(附源代码) - 懒猪学IT
  3. 3 Updated: Continuous scrolling image thumbnail and slideshow component for Flex. at building blocks

Leave a Reply