Array problem?

Hello!

Been a while since I’ve been here…tee hee. :hugegrin: Anyway, I’ve been working on a project…that will report to me the files in a folder in my hard drive. I’m sending the results of my array (of the files in the folder) to a string in a this manner:


//This is actually a dynamically generated variable and not a static one.
var files:Array = ['blah.jpg','blah.jpg','blah.jpg','image.jpg'];
//Declaring the string to store array in...
var filesString:String;
for(var i:Number = 0; i<files.length; i++){
     filesString = fileString+" "+files*;
}

I’m needing to find the file called “image.jpg” and position it a the beginning of the string, like this:

image.jpg blah.jpg blah.jpg blah.jpg

However, each time I run the for loop, “image.jpg” might be in a different place. Is there a way to put image.jpg a the beginning no matter what?

Any help or comment is greatly appreciated!

Thanks!