Sorry I took so long. I had no internet at home for that past couple of days.

...Well, you don't really have to make it an array. I guess I should have said, use it like you would an array.

Since it seems you want to know how to keep the original order and have a new list with a randomized order,for ease of use, I figured you might want an XMLList, so I made the example below.

//there is another way without duplicating data in memory, but I figure this might be easy to work with.
var ss:XML =<SLIDESHOW SPEED="2"><IMAGE SRC="images1.jpg" DESC="Rome"/>
<IMAGE SRC="images2.jpg" DESC="Paris"/>
<IMAGE SRC="images3.jpg" DESC="Cairo"/>
<IMAGE SRC="images4.jpg" DESC="London"/>
<IMAGE SRC="images5.jpg" DESC="New Yor City"/>
<IMAGE SRC="images6.jpg" DESC="Paris"/>
<IMAGE SRC="images7.jpg" DESC="Tokyo"/>
<IMAGE SRC="images8.jpg" DESC="Toronto"/>
<IMAGE SRC="images9.jpg" DESC="Nepal"/>
<IMAGE SRC="images10.jpg" DESC="Venice"/>
<IMAGE SRC="images11.jpg" DESC="what"/>
<IMAGE SRC="images12.jpg" DESC="ever"/>
<IMAGE SRC="images13.jpg" DESC="you"/>
<IMAGE SRC="images14.jpg" DESC="get"/>
<IMAGE SRC="images15.jpg" DESC="the"/>
<IMAGE SRC="images16.jpg" DESC="idea"/>
</SLIDESHOW>;
var imgList:XMLList = ss.IMAGE;
function randXMLList(xl:XMLList):void{
    var sn:int;//swap number
    var xh:XML;//temp xml holder
    var i:int=0;
    var l:int = xl.length();
        while(i!=l){
            sn = Math.floor(Math.random() *l);
            xh = xl[i];
            xl[i] = xl[sn];
            xl[sn] = xh;
            ++i;
        }
}
randXMLList(imgList);
trace(imgList);





On 1/21/2011 3:47 PM, Christopher Lucas wrote:
Anthony, Thanks for your response. I conceptually understand Arrays, but
really am lost in how they work with AS3. Any change you might be willing to
show me how this would be done?

Won't the image and corresponding desc both be scrambled in an array since I
want to display them together?

Thanks
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to