Random pic from library w/o repeat

Hi all,

Like the topic said, I’m trying to load an image out from a list of images (which stored as separate movie objects) onto the stage without repeating once the button is pressed; but, for some reason, it just not work as expected…

So far, this is what I have on the button:

var piclist:Array = new Array("s1","s2","s3","s4","s5");
randompic = piclist[Math.floor(Math.random()*piclist.length)];
show_mc = attachMovie(randompic, randompic, 1);
show_mc._x = 270;
show_mc._y = 170;
piclist.splice(randompic, 1);

IF, possible, I’d like to display one last image that shows the array has been emptied and require to start over into the script…

Thanks for any sort of help!