all groups > flash actionscript > january 2006 >
You're in the

flash actionscript

group:

Preloader does not execute



Preloader does not execute stever4633
1/18/2006 10:36:02 PM
flash actionscript: I have created a simple preloader that looks at the number of frames loaded and
compaires it to a preset number. I am using FlashMX. The Movie is made up of
two scenes. The first "PreLoader" which has two frames, First frame has the
folllowing Action Script:
nBytesLoaded = this.getBytesLoaded();
nLoadedKbs = int(nBytesLoaded/1024) add " KB";
BytesLoaded.text = nLoadedKbs;
nBufferSize = "1000";
// time
time = getTimer()/1000;
// Calcuate download speed
nSpeed = nBytesLoaded/time;
nBits = nSpeed/1024;
nKbps = Math.round(nBits*10)/10 add " KB/S";
Speed.text = nKbps
// Get frames loaded
nFramesLoaded = this._framesloaded;
FramesLoaded.text = nFramesLoaded;
// Calcuate percentage of frame buffer filled
percentage = Math.round(nFramesLoaded/nBufferSize*100);
infodisplay.text = percentage+" %";
// If frame buffer is full play movie
if (percentage>=100) {
gotoAndPlay(3);
}
The second Frame:
gotoAndPlay(1);
The Second Scene "SlideShow" Contains 6535 frames.

It works if I do an CTL+Enter, CTL+Enter

When published to the web I never see the preloader section run and it starts
playing after a very short delay. Is there some setting in Flash that needs to
be changed to get the preloader to work?
Re: Preloader does not execute kglad
1/18/2006 11:06:31 PM
nBufferSize is a string, not a number so percentage is NaN.
Re: Preloader does not execute stever4633
1/19/2006 11:09:48 PM
Re: Preloader does not execute kglad
1/20/2006 1:47:28 AM
AddThis Social Bookmark Button