I’m trying to find a way to automatically load several assets into my project made in AS3.
Scenario: I have 135 .png files I need to load, I have a ResourceManager class that can load this through embeds or loaders, nothing new. There is a little problem, I need to provide every single name (../assets/myImage.png) everytime I make an embed/loader. I dont want to.
Is there a way to specify a path, and somehow, automatically load every single file that ends in, let say, .png?.
I was thinking on making a .bat program that makes a list of files ending in .png, wich could make a .txt file, and then using AS3, just loop throught that file and make the asset loading using the Loader class.
Any ideas?
Thanks.
I’d suggest you use a server script such as PHP to return a formatted xml file, such as in this tutorial: folder content in xml file
Then you’ll just have to read that file and load in the files.
I often use the BulkLoader class to assist in loading multiple assets like this.