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:
stop();
var myPercent:Number;
import fl.controls.ProgressBarMode;
myBar.mode=ProgressBarMode.MANUAL;
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);
gotoAndStop(2);
}
}
The problem is as you can see from http://www.gemixin.co.uk/UELVirtualLab.html 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?