Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
imoverhere

loader failing when going to server

Recommended Posts

Hello,

 

I just went live with this loadermax and the client was expecting it today. :(  When I load the swf on my site, the swf crashes.  I can't get any feedback on where the crash is since it's on the server.  In development this works fine.  I have two files which need to be loaded and which are in the the same directory as the swf.  There are two files: 9508i8152.xml and Configuration.csv (around 500K large).  This worked with my web site before the addition of GreenSock.  So i know the html and callback code is correct.  Here's my code.  Please  help :)

 

        private function initForDevelopment ():void {
            contentURL = "9508i8152.xml"            
            loadExternalFilesDevelopment (contentURL);                
            
        }            
        private function initForProduction ():void {
            addCallbacks();  
            contentURL = "9508i8152.xml"
            loadExternalFilesProduction (contentURL);    
        }

 

        private function loadExternalFilesDevelopment (contentURL):void {
            //create a DataLoader for loading text (the default format)        
            //create a LoaderMax named "mainQueue" and set up onProgress, onComplete and onError listeners
            var queue:LoaderMax = new LoaderMax({name:"mainQueue", onProgress:progressHandler, onComplete:completeHandlerDevelopment, 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 loadExternalFilesProduction (contentURL):void {
            //create a DataLoader for loading text (the default format)        
            //create a LoaderMax named "mainQueue" and set up onProgress, onComplete and onError listeners
            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");
            //            trace("complete. myText: " + text);
            var xml:XML = LoaderMax.getContent("myXML");
            content = new Content (grid, text, xml); 
            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");
            content = new Content (grid, text, xml);
            content.parseConfig (text);
            
        }

Link to comment
Share on other sites

This fla file gets values from a text field on the web page.  Using the loadermax structure, what should i do when get that?

        private function addCallbacks (): void  {  
            if(ExternalInterface.available)  {              
                //registers the js function called sendToFlash so when it's invoked
                ExternalInterface.addCallback("sendToFlash", sendToFlashHandler);  
                ExternalInterface.addCallback("getExt", getExtHandler);
            }            
        }        
        
        private function sendToFlashHandler(value:String) : void  {  
            //    this is when we get the ext on windlow load.              
            content.personSpecs.ext = value;
            urlConfigLoader.reloadConfig();      

Link to comment
Share on other sites

Hi

 

Sorry to hear you are having problems. Unfortunately I can not just look at your code and know where the problem is. 

Nothing jumped out at me at first glance.

 

Some suggestions

 

1. set up onError and onComplete callbacks on your loaders that display messages in your swf so that you can accurately track what is loading and what isn't.

instead of using trace("some message"), populate a textfield on the stage

 

error_txt.text += "some message"

 

2. use a tool like monster debugger to debug hosted swfs: http://www.demonsterdebugger.com(will display traces)

 

3. reduce your code to the bare minimum, test, if it works, add more. repeat. 

 

If you find that there is an error related to LoaderMax, please provide a very simple and reduced set of files that clearly illustrates the problem that we can compile and test. 

 

Hopefully this gets you closer to a solution. 

 

Sorry, but I really don't know what is supposed to happen with the ExternalInterface calls, its completely foreign to me. 

Link to comment
Share on other sites

Two follow ups.

1. If the two files I need to load are in the same directory, can i just use the file name like in my example above for "Configuration.csv" and 9508i8152.xml?  I did that in my example above.  Will that work?

 

2. I'm getting Error 2032 when set a text field to the error.  This code "NEW At Error " + event.target + ": " + event.text; produces this error in my swf:

 

NEW At Error DataLoader 'myText' (Configuration.csv): DataLoader 'myText' (Configuration.csv) > Error #2032

 

Any thougts on the cause?  I searched the forum here for Error 2032.  I did add new XML tags to my xml file.  But this file in the error is .csv.

 

I'd really appreciate your insight.  20 hour day.  Off to bed.

Link to comment
Share on other sites

The 2032 error was my fault.  In all my testing, I removed the Configuration.csv file from the folder.  I replaced the file and the 2032 error stopped.  But I'm still failing to get both files in my queue to download.  I'll start a new thread with deatils.  Let's end this thread.

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