Jump to content
GreenSock

imoverhere

complete handler only getting one file at a time.

Recommended Posts

I'm trying to load two files.  On my devlopment machine, both load fine using this code.  Going to production, only one loads at a time.  Each loads fine when there is only one in the queue.  What am i missing?

 

        private function initForDevelopment ():void {
            //====== DEVELOPMENT        
            contentURL = "9508i8152.xml"                    
            loadExternalFilesDevelopment (contentURL);                
            
        }            
        private function initForPRODUCTION ():void {
            //====== PRODUCTION
            addCallbacks();  
            contentURL = "9508i8152.xml"
            loadExternalFilesPRODUCTION (contentURL);    
        }
        
        private function loadExternalFilesDevelopment (contentURL):void {
            var queue:LoaderMax = new LoaderMax({name:"mainQueue", onProgress:progressHandler, onComplete:completeHandlerDevelopment, onError:errorHandler});
            queue.append( new XMLLoader(contentURL, {name:"myXML"}) );
            queue.append( new DataLoader("Configuration.csv", {name:"myText", requireWithRoot:this.root, estimatedBytes:900}));

            queue.load();
        }
        private function loadExternalFilesPRODUCTION (contentURL):void {  
            var queue:LoaderMax = new LoaderMax({name:"mainQueue", onProgress:progressHandler, onComplete:completeHandlerPRODUCTION, onError:errorHandler});
            //append several loaders
            queue.append( new XMLLoader(contentURL, {name:"myXML"}) );
            queue.append( new DataLoader("Configuration.csv", {name:"myText", requireWithRoot:this.root, estimatedBytes:900}));
            
            //start loading
            queue.load();
        }
        
       
        private function completeHandlerDevelopment(event:LoaderEvent):void {
            var text:String = LoaderMax.getContent("myText");

            var xml:XML = LoaderMax.getContent("myXML");
            content = new Content (grid, text, xml);
            content.personSpecs.ext = 136;    
            content.parseConfig (text);           
        }

        private function completeHandlerPRODUCTION(event:LoaderEvent):void {
            var text:String = LoaderMax.getContent("myText");
            //            trace("complete. myText: " + text);
            var xml:XML = LoaderMax.getContent("myXML");
            pScreen.error.text = pScreen.error.text + "CompHandler:  myText "+text+" myXML = "+xm
            
        }

Link to comment
Share on other sites

I'm embarrased and tired.  I was tracing the files to a text field on the screen.  But the files were longer than the field.  I text.substr out the files and see that both are there.  So the loader is working fine.  It's just me again :)

Link to comment
Share on other sites

No worries. It happens to all of us. Glad you got it figured out.

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.
×