Preloader from document class

I know this subject has been on forums more than anything else but I can’t find solution for my problem. I have SWF file which loads list of images from XML file, then it launches couple instances of loader class to load them all, everything works great images are getting loaded and loader SOMETIMES shows the loading progress and this is my problem that loader is not always being showed. Sometimes there is like 15s waiting and everything pops out together (images and preloader) which is wrong. I know that some people place preloader in 1st frame but I have lots of code in Document Class and when I use classes I can’t place any code on timeline as error pops out. So how can I fix this ???

(important parts of the code below)

public function main()
{
    xmlInit();
}

private function xmlInit()
{
    // Loading xml data here
    imagesInit();
}

private function imagesInit()
{
    for(var i:int=0; i<xmlData.children().length(); i++)
    {                
        xmlTotal++;
        var a:Loader = new Loader();
        a.load(new URLRequest(xmlData.children()*.a));
        a.contentLoaderInfo.addEventListener(Event.COMPLETE, photosComplete, false, 0, true);
        a.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, photosProgress, false, 0, true);
        photos.push(a)
    }
}

function photosProgress(evt:ProgressEvent):void
{
    percent = 0;
    loaded = 0;
    total = 0;
    
    for(var i in photos)
    {
        loaded += photos*.contentLoaderInfo.bytesLoaded;
        total += photos*.contentLoaderInfo.bytesTotal;
    }
    percent = loaded / total;
    //txtFld.text = Math.floor(100 * percent) + "%";
    txtFld.text = loaded;
}

function photosComplete(evt:Event):void
{
    xmlDone++;
    
    // Check if all images were loaded
    if(xmlDone == xmlTotal)
    {                
        for(var i in photos)
        {
            var sprite:Sprite = new Sprite();
            var bmp:Bitmap = Bitmap(photos*.content);
            bmp.smoothing = true;
            sprite.addChild(bmp);
            photos* = sprite;
            addChild(photos*);
            photos*.name = "img"+i+"a";
        }
        
        stage.addEventListener(MouseEvent.MOUSE_UP, onDrop, false, 0, true);
        addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
        init(); // Run the rest of the code
    }
}