PDA

View Full Version : Preloader problem (newbie)


chelnov63
03-03-2005, 04:04 PM
Hi im a newbie and was creating a preloader but there is a bizarre problem( i think) in the bandwidth profiler.

Basically i have three layers actions layer , preloader layer and movieAnimation layer(this has an embedded movie of about 117 frames, starting at frame 2).

The code on Actions layer is :

stop();
_root.onEnterFrame=function(){
this.bytesLoaded_txt.text=getBytesLoaded();
this.totalBytes_text.text=getBytesTotal();
}
myInterval = setInterval(preloader,10);
function preloader(){
if(getBytesLoaded()>=getBytesTotal()){
play();
clearInterval(myInterval);
}//end if
loader_mc._xscale=((getBytesLoaded()/getBytesTotal())*100);
}//end preloader

Now in the bandwidth profiler(with simulated download mode on and modem at 56K(4.7Kbps) this works as expected i.e the playhead doesnt start moving until all the frames have loaded as shown by the streamer and also the dynamic text fields i have created..

But when i change the speed say to DSL(32,6 Kbps) The playhead doesnt wait for all the frames to load, instead just after about 4 or 5 frames have loaded it starts to play and due to this keeps catching up with the streamer and halting for more frames to download....

Does anyone know why this is happending? its really confusing :confused: ... i mean irrespective of the speed, the playhead shudnt start to play until all the bytes have been loaded!!!

Thanks for ur help in advance .... cheers