PDA

View Full Version : Please Help with "NetStream"...


gintonic
10-22-2003, 11:40 AM
Hi there,

I try to know the "% preload" of my "NetStream"...
I Know I can use : "NetStream.bytesLoad" and "NetStream.bytesTotal", but how... what's wrong in my code.

fSetConnect = function(vWhichFlv){
objNetCon = new NetConnection();
objNetCon.connect(null);

objNetStream = new NetStream(objNetCon);
objNetStream.setBufferTime(20);
mcVideo.attachVideo(objNetStream);

objNetStream.play(vWhichFlv);

}

fSetConnect.prototype.fBufferCheck = function(){
vBytesLoaded = objNetStream.bytesLoaded;
vBytesTotal = objNetStream.bytesTotal;
vPercentLoad = Math.floor(vBytesLoaded/vBytesTotal * 100);

if(vPercentLoad >= 100){
clearInterval(vInter);
mcPreload._visible = 0;
//objNetStream.play(vWhichFlv);
}else{
mcPreload._xscale = vPercentLoad;
}
}

var vNewFlv = new fSetConnect('testHalf.flv');

I think "objNetStream.play('testHalf.flv')" is place to early in my code... because it start to play before the preload...

Thanks in advance...

hangalot
10-23-2003, 04:55 AM
are the bytesloaded properties or methods?
to thst i it is a method trace it if it returns something like [Function] then its a mthod and should be called with ()