Well, to check the files inside your folder, the simple var files:Array = assets.getDirectoryListing();
give you what you need,
Now the problem is how to know if your files are updated or not ... basically if they always have the same name you just can't ... what I did, is generating a random number, each time to add new files, and add it to the file name, and when you'll check, if you have the same number so no need to update, and in the other case you update,
This is just an idea of what you can do, if you're interested, I can help you along,
Cheers !!
Here is an example that might make it a little clearer :
what I did is :
The file name on the xml look like this : file_name?123123
and when I read the xml once again I do this to check :
var arr1:Array = filename.split("?"); // file name from the localStorage
var arr2:Array = xml.file.name.toString().split("?"); // file name from the XML file
if(arr1[arr1.length -1] != (arr2[arr2.length -1]){
//download the new file and replace the old file
}
ps : I have done this with ?
because @
made some problems when reading the xml, and since I'm working on Windows, and it doesn't accept that in the file name so before storing it I change the file name by just fileName.split("?").join("@");