Preloader problem: ref and completion errors

EDIT: I think I’m already on the second page, but I thought I’d still mention that my problem seems to be exactly like one asked about in the official forum here…

http://forums.adobe.com/thread/685609?tstart=1

Hello, I’ve been trying to make an external preloader file (it’s really just the code you get from the preloader template in the new file menu) and it’s giving a weird error. There are a few threads about preloaders and some of this error but I can’t seem to find an answer.

The project actually seems to work, but it bothers me none the less.

It starts like this…

Error #2044: Unhandled IOErrorEvent:. text=Error #2036: Load Never Completed.

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at Pre_fla::MainTimeline/setBarProgress()
at Pre_fla::MainTimeline/loading()

…but the part about typeerror is repeated infinitely. It seems like the “load never completed” part only shows if I select simulate download from the preview window.

FUTURE EDIT: Actually the reference error goes away when I comment out the line that changes the scaleX of the progress bar movieclip, which doesn’t make any sense because if it couldn’t find it it should be able to change it’s scale when I leave it un-commented…?

Here’s the code, this and the loader image movieClip are all that’s in this project:

var contentLoader:Loader; 
loadContent("Pre-Loader_external_content.swf"); 
  
function loadContent(url:String):void { 
    contentLoader = new Loader(); 
    contentLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loading); 
    contentLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, contentLoaded); 
    contentLoader.load(new URLRequest(url)); 
} 
  
function contentLoaded(evt:Event):void {
    //Optionally change to a clip holder and set progressbar visibility.
    addChild(contentLoader); 
} 
  
function loading(evt:ProgressEvent):void { 
    var loaded:Number = evt.bytesLoaded / evt.bytesTotal; 
    setBarProgress(loaded);
    
    if(evt.bytesLoaded == evt.bytesTotal){
        trace("Loaded")
        //This shows up.
    }
} 

function setBarProgress(value:Number) { 
    progressbar.bar.scaleX = value;
}

Note the part about tracing “loaded”? It repeats that infinitely too. As it says, it’s not completing.

Now if you do try and call a swf from the template it works fine as long as the swf only makes use of objects generated in flash. All the swf I’m trying to load, the one labeled “Pre-Loader_external_content.swf” is is a new flash document that I drug a picture onto. The picture isn’t linked externally, it’s in the library of the content project.

Like I said the loader works and adds the content when done, but I’m afraid it might cause problems later with actual viewing.

Any help about this is appreciated.

EDT: Other threads I’ve now found, but I’m not sure they pertain to exactly the same thing now…