toke
04-09-2003, 08:54 PM
can anyone tell me why this code is not working when I view from a server?
I have
mSound = new Sound();
mSound.loadSound("mp3/temp.mp3");
var fullyLoaded = false; //this I got from other post
sndFrameFunc(); //same, got from other post
//got from other post -- thank you very much very helpful and useful
function sndFrameFunc(){
if(!this.fullyLoaded){
var t = mSound.getBytesTotal();
totalbytes.text=t;
var l = mSound.getBytesLoaded();
bytesloaded.text=l;
var pc = l/t;
percentdone.text=pc*100 + "%";
this.loadBar2._width=pc*100;
if(t && l == t){
this.fullyLoaded=true;
}
}
};
it returned the following values:
total bytes >> showed nothing
bytes loaded >> 0
percentdone >> NaN%
but when I view this from a local machine, the code worked. anybody knows?
I have
mSound = new Sound();
mSound.loadSound("mp3/temp.mp3");
var fullyLoaded = false; //this I got from other post
sndFrameFunc(); //same, got from other post
//got from other post -- thank you very much very helpful and useful
function sndFrameFunc(){
if(!this.fullyLoaded){
var t = mSound.getBytesTotal();
totalbytes.text=t;
var l = mSound.getBytesLoaded();
bytesloaded.text=l;
var pc = l/t;
percentdone.text=pc*100 + "%";
this.loadBar2._width=pc*100;
if(t && l == t){
this.fullyLoaded=true;
}
}
};
it returned the following values:
total bytes >> showed nothing
bytes loaded >> 0
percentdone >> NaN%
but when I view this from a local machine, the code worked. anybody knows?