Loading text to array from diferent folders?

hello.

I’m trying to figure out something that i don’t know if it is possible:

Loading into the Array “List” several text files, that should load from six or seven diferent files located in the same folder as the .swf.

what I have now is the following example, the list is created manualy, and loads the files in order.

List = new Array(‘1’, ‘2’, ‘3’);

How can I set it up so that it goes to a folder first, loads all the text files in order, and after finishing goes to another random folder?

Thanks

I guess you will need to put all the paths to the different folders in an array so that they can be called upon randomly.

Then each of the files in a folder needs to be put in an array and the contents of that array need to be ordered. And since it appears your using numbers as the text file name you can just call the sort() method. Put this code in a frame and preview it with ctrl+enter and look in the output you will get.


List = Array("3", "6", "1", "99", "2");
trace(List.toString());
trace("--------------------")
trace("IN ORDER ::: " + List.sort());

Regards,
Viru.