PDA

View Full Version : Forming an Array with a .txt file



jstn1011
October 24th, 2004, 10:45 PM
I am trying to create an array in flash using a .txt file. I cannot figure out how to get an array to recognize the numbers in the text file. For example...I create an array by writing...allImgsArry=new Array (). Usually I would add my array contents in the parenthesis, but i need to add the contents from my text file into the parenthesis instead. This is because the end user wants to be able to rearange the array contents by only using the text file. If you have any ideas or need further explanation of the question, please let me know.

Thanks

SmurfMX
October 24th, 2004, 11:26 PM
First read in the txt file as a string wherein all the elements are seperated by a , . Then all you have to do is.


var allImgsArr:Array = varFromTxtFile.split(",");