The problem is that everytime you call
selectRandom() you're assigning
filename all of your clips again. You need to move the lines filename = and path = somewhere outside of your function. This might be more of what you're looking for:
ActionScript Code:
filename = ["p1_1.swf", "p1_2.swf", "p1_3.swf", "p1_4.swf", "p1_5.swf", "p1_6.swf"];
path = "http://a.parsons.edu/~lisa/spring05/interactivity/final/swfs/";
selectRandom = function(){
k = random(filename.length-1);
randomFile = filename[k];
filename.splice(k,1);
return(randomFile);
}
Then you could use it somewhere like:
ActionScript Code:
filePath = path + selectRandom();
Hope it helps some,
-C