Jump to content
Search Community

How can I load an random quantity of files?

imoverhere test
Moderator Tag

Recommended Posts

Hello,

First, let me thank you for your product!  It has been great to use.

I need to change the way I am loading files.  Going forward there will be an undetermined number of files to load. 

Currently, I have one XML and three Text files which are titled Configuration.csv.  Here’s my code which loads all the files correctly.  But going forward I will have an unknown number of Configuration files.  It could be from 1 to a few hundred.  But most likely, 1-15 or so.  I thinking of creating a loop which would iterate through the variations of the potential “ConfigurationX” names until I got a failure.  Then my error handler would somehow get me out of the loop.  But, the more I thought of it, the more confused I got.  How would you structure the loader?  Is my scenario accounted for in your code?

 

Thanks in advance for your help!

Kevin

 

            private function completeHandlerDevelopment(event:LoaderEvent):void {

                  var xml:XML = LoaderMax.getContent("myXML");

                  var text:String = LoaderMax.getContent("myText");

                  var text1:String = LoaderMax.getContent("myText1");

                  var text2:String = LoaderMax.getContent("myText2");

                  var text3:String = LoaderMax.getContent("myText3");

 

                  configsArray.push(text, text1, text2, text3);

                  postHandlerInit (xml, configsArray);                 

            }

            private function completeHandlerDevelopment(event:LoaderEvent):void {

                  var xml:XML = LoaderMax.getContent("myXML");

                  var text:String = LoaderMax.getContent("myText");

                  var text1:String = LoaderMax.getContent("myText1");

                  var text2:String = LoaderMax.getContent("myText2");

                  var text3:String = LoaderMax.getContent("myText3");

 

                  configsArray.push(text, text1, text2, text3);

                  postHandlerInit (xml, configsArray);                 

            }

            private function errorHandler(event:LoaderEvent):void {

                  //nothing here

            }

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...