Groups | Blog | Home
all groups > flash actionscript > december 2004 >

flash actionscript : levels preloader trouble.


Chris J
12/30/2004 11:46:22 PM
I am using the following to try to run an animation preloader while a main
movie loads on level1.
function checkload() {
var lbytes = _root.getBytesLoaded();
var tbytes = _root.getBytesTotal();
var percentloaded = Math.floor((lbytes/tbytes)*100);
loader.bar._xscale = percentloaded;
loader.percent.text = percentloaded +" % " + Math.floor(tbytes/1024) + "k
loaded";
if(_level1.getBytesLoaded >= _level1.getBytesTotal) {
if(count>=12) {
clearInterval(checkprogress);
loadMovieNum("main.swf",1);
if(_level1.getBytesLoaded >= _level1.getBytesTotal) {
gotoAndStop(2);

}
}else{
count++;
}
}
updateAfterEvent();
}
checkprogress = setInterval(checkload,50);
stop();


It does load the main.swf in frame 2 however, it does not loop the mc in
frame 1 while main.swf loads in the background.

Any help will be appreciated.
cj

NSurveyor
12/31/2004 5:44:21 AM
Your script has errors. You wrote: getBytesLoaded and getBytesTotal when in fact they should be getBytesLoaded() and getBytesTotal()

AddThis Social Bookmark Button