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

flash actionscript : NaN showing in preloader w/ Netscape


Bloke
6/20/2004 8:09:56 PM
My preloader is showing "NaN%" for a second when using Netscape. I know it has
something to do with the delay as flash is wait for a response from the server.
How can I get it to show 0% ?

this.loadbar._visible = false;
percent_display = "";
this.createEmptyMovieClip("container", 10);
container.loadMovie("movie.swf");
this.onEnterFrame = function() {
percent = (this.container.getBytesLoaded()/this.container.getBytesTotal())*100;
if (!isNan(percent)) {
if (percent == 0) {
percent_display = "";
} else {
percent_display = Math.ceil(percent)+"%";
}
this.loadbar._visible = true;
this.loadbar._xscale = percent;

}
container.stop();

if (percent == 100) {
delete this.onEnterFrame;

percent_display = "";
this.loadbar._visible = false;
loadMovieNum("movie.swf", 0);
}
}
stop();


kglad
6/20/2004 8:28:04 PM
this.onEnterFrame = function() {
if (this.container.getBytesLoaded()>0) {
if (this.container.getBytesLoaded()>=this.container.getBytesTotal()) {
delete this.onEnterFrame;
percent_display = "";
this.loadbar._visible = false;
loadMovieNum("movie.swf", 0);
} else {
percent =
(this.container.getBytesLoaded()/this.container.getBytesTotal())*100;
percent_display = Math.ceil(percent)+"%";
this.loadbar._visible = true;
this.loadbar._xscale = percent;
container.stop();
}
}
};
AddThis Social Bookmark Button