-
Preloader 1001
Hi I have a litle problem with my preloader.
In my preloader movie I have this script( see below) where I load "index.swf" into "holder".
When I test it, it will only output 0% and 100% loaded,
when I try to set down the bandwidth to see the progress it will not show the percentage
anyone knows why?
regards Thomas
The script
this.createEmptyMovieClip("holder",1);
holder.loadMovie("index.swf");
this.onEnterFrame=function(){
//trace the percentage of the movie that has loaded
percent=(this.holder.getBytesLoaded()/this.holder.getBytesTotal())*100;
if(!isNan(percent)){
trace(percent+"% loaded");
}else{
trace("0% loaded");
}
if(percent == 100){
delete this.onEnterFrame;
}
}
-
This won't work when testing the loaded movie locally... But will if tested online, and assuming your internet cache was cleared between tests.
If you want to test it locally, upload the "to be loaded" movie to some web space, and use that full online url instead in your script. Once again make sure your internet cache is cleared between each test, or append an unique number to your .swf's name, so that the cached file is never re-loaded.