Preloader/progress bar problems

I’ve got an SWF that’ll be viewed via a webpage, that loads a choice of 7 different web pages/SWFs depending on buttons clicked.

The problem is these files are quite big and take a good few seconds to load each, so for each SWF, I created a progress bar on frame 1, that then loads frame 2 (where all the code and content is) once it’s ready. The code I used is as follows:


var myPercent:Number;
import fl.controls.ProgressBarMode;


stage.addEventListener(Event.ENTER_FRAME, loadProgress);

function loadProgress(e:Event) :void
var bytesLoaded = stage.loaderInfo.bytesLoaded;
var bytesTotal = stage.loaderInfo.bytesTotal;
myBar.setProgress(bytesLoaded, bytesTotal);

myPercent = bytesLoaded/bytesTotal;
statusTxt.text = String(Math.round(myPercent*100))+"%";

if (bytesLoaded==bytesTotal) 
    stage.removeEventListener(Event.ENTER_FRAME, loadProgress);


The problem is as you can see from is that it takes ages to load the loader! So I end up with a blank screen then the loading bar, then the content. Making the loading screen pretty useless!

Any ideas on how to make it so frame 1 shows up straight away?