Random image slideshow using only actionscripts?

Hi, i just joined, and this looks like a really nice community, im also quite new to flash, well, mostly to the actionscript part, since i’ve work alot with animation in it.

What i would like to know is following:
I got 10 images inside swf’s, named from 00.swf to 09.swf, how do i make another movieclip, load them, display them in a slideshow where they fade from image to image randomly, and when the image is not shown, it should be unloaded. I used .swf file because i got effects on the images.

i hope i was detailed enough in my description, and i truely hope you guy can help me.

Thanks in advanced for any help you give me, and Meryy Christmas!

p.s. im using flash MX

your description is a little hairy, but Ill describe how to do what I think you meant to explain… if that makes sense :wink:

ok, so you got the external swfs, each can be loaded, but of course not all at once (you are limited to 4 continuous download streams) but of course its not like they are all going to load instantly anyway… well first off, lets get the random bit out of the way first. For reusabilitis sake, we’ll manually layout an array of the swf names. You have them numerical which could make it easier if by code, but since that might not always be the case (and if someone else wants to use this too) its good to know this method. So layout the swfs in an array:

images = [“00.swf”,“01.swf” … “09.swf”];

now randomize it using the Array.sort method

images.sort(function(){return random(2)*2-1;});

passed is a function which acts as the sortOrder function for the sort command. This allows you to manage how the sorting behaves. I made the function return a random -1 or 1 which will sort things randomly. Now, since the images array is sorted, we can start loading these guys in.

Basically this revolves around a repeating seqence of events to be used as each image is loaded, faded in, shown, faded out, and unloaded followed by another. in pseudo code it will happen like this
(setup: 2 empty movieclips on the timeline both with initial _alpha of 0)

load next array image in clip 1
when loaded swapdepths clip 1 above clip 2
fade clip 1 in
load next image into clip 2
wait for ‘view time’
once ‘view time’ has been passed, if clip 2 isnt loaded, wait for it
once view time has been passed and clip2 is loaded, swap depths clip 2 above clip 1
fade clip2 in
load next array image in clip 1, replacing the old
… repeat process until all clips loaded and played

the code in getting that done can be a bit involved, but its not exactly HARD I wouldnt think, just a bit monotonous. I dont have any to give simply because Im too lazy :wink: Im sure there are plent of examples out there doing this and shouldnt be hard to find