PantherRun
Technical User
Hey out there;
I'm in the process of optimizing my movies. Someone pointed out that my preloader that someone made for me, might be preloading 'everything' before letting the viewer see anything. He recommneded that i put into the script 'if so many frames or bits or whatever is loaded, then start playing', thus cutting down on that dreaded wait period.
Okay, so i'm reading up on that.
What I'd like to ask you: would you look at the preloader code below and tell me if it is indeed insisting on loading everything before showing anything, before i go messing with this preloader?
If so, would you help make it better?
On the preloader's timeline are 3 frames with code.
frame 1 =
_parent.stop();
frame 2 =
kBytesLoaded = (_parent.getBytesLoaded()/1024)/3;
kBytesTotal = (_parent.getBytesTotal()/1024)/3;
kBytesRemaining = kBytesTotal - kBytesLoaded;
percentLoaded = 100 * kBytesLoaded / kBytesTotal;
percentRemaining = 100 - percentLoaded;
progress = Math.floor(kBytesLoaded) add " of "
add Math.floor(kBytesTotal) add " kBytes";
loadBar._xScale = percentLoaded;
kBytesSec = kBytesLoaded/(getTimer()/1000);
timeRemaining = kBytesRemaining / kBytesSec;
times = Math.floor(timeRemaining) add " seconds remaining";
frame 3 =
if(percentLoaded < 99){
gotoAndPlay(2);
}else{
_parent.play(5);
stop();
}
As you look at this, I'd like to ask you another question, anything else that you might change to make it better?
Thanks
Hoss
I'm in the process of optimizing my movies. Someone pointed out that my preloader that someone made for me, might be preloading 'everything' before letting the viewer see anything. He recommneded that i put into the script 'if so many frames or bits or whatever is loaded, then start playing', thus cutting down on that dreaded wait period.
Okay, so i'm reading up on that.
What I'd like to ask you: would you look at the preloader code below and tell me if it is indeed insisting on loading everything before showing anything, before i go messing with this preloader?
If so, would you help make it better?
On the preloader's timeline are 3 frames with code.
frame 1 =
_parent.stop();
frame 2 =
kBytesLoaded = (_parent.getBytesLoaded()/1024)/3;
kBytesTotal = (_parent.getBytesTotal()/1024)/3;
kBytesRemaining = kBytesTotal - kBytesLoaded;
percentLoaded = 100 * kBytesLoaded / kBytesTotal;
percentRemaining = 100 - percentLoaded;
progress = Math.floor(kBytesLoaded) add " of "
add Math.floor(kBytesTotal) add " kBytes";
loadBar._xScale = percentLoaded;
kBytesSec = kBytesLoaded/(getTimer()/1000);
timeRemaining = kBytesRemaining / kBytesSec;
times = Math.floor(timeRemaining) add " seconds remaining";
frame 3 =
if(percentLoaded < 99){
gotoAndPlay(2);
}else{
_parent.play(5);
stop();
}
As you look at this, I'd like to ask you another question, anything else that you might change to make it better?
Thanks
Hoss