2 Replies Latest reply on Apr 8, 2008 8:37 AM by alyda

    help with array collection

      Hi, i'm trying to create a slideshow with an rss feed from flickr. i am using a datagrid component to store the images (because of the transitioning effects when i add or delete an item from its dataProvider. I can go through the images very effectively by simply removing the first item in the array collection, but then i get to the end and of course the slideshow doesn't look because i've removed all the items. is there an easy way for me to simply take the first object in the array collection and move it to the end? i've tried photoFeed.setItemAt(object, int); but i don;t know how to call on the first object of the array collection. also, for the int variable i try to use photoFeed.length because i want to it move to the end of the array which the length should be the correct number since the array's indexing start at 0.
        • 1. Re: help with array collection
          Sreenivas R Adobe Employee
          Though I am unable to understand the requirement of moving an item to the end for a slide show, you can use

          var item:Object = photoFeed.removeItemAt(0);

          to achive what you want.

          If you simply want to traverse the images one by one till the end you just need to use the createCursor API and obtain a cursor. By calling moveNext on the cursor you navigate through the collection till moveNext returns false.
          • 2. Re: help with array collection
            alyda Level 1
            thanks for the reply, i'll try your suggestion about the createCursor, but it sounds like the collection won't continue once it gets to the end? i'm trying to create an endless slideshow. but thanks again for the help!