# Buffering problem

**URL:** <https://forum.kirupa.com/t/buffering-problem/95526>\
**Category:** Uncategorized\
**Created:** [November 26, 2003, 5:50pm UTC](https://forum.kirupa.com/t/buffering-problem/95526 "2003-11-26T17:50:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kevinv033](https://avatars.discourse-cdn.com/v4/letter/k/65b543/32.png) [@kevinv033](https://forum.kirupa.com/u/kevinv033)\
**Post date:** [November 26, 2003, 5:50pm UTC](https://forum.kirupa.com/t/buffering-problem/95526/1 "2003-11-26T17:50:49Z")

</div>

ok. hope someone can help. i made a little buffer script for dynamically loaded mp3s. it’s supposed to play the file after 20% is loaded (these files are a couple of MB).

anyway, it doesn’t play after it’s buffered to the 20%.

works when i just test movie in flash.

doesn’t work when i test “streaming” in flash.

i am thoroughly confused…:crazy:

here’s my buff script, etc.

let me know if you need anymore info…

```auto
nrMix=new Sound(djsetMC);
nrMix.loadSound([file], false);
preloadNow=false;

this.onEnterFrame = function(){
	bytesT = nrMix.getBytesTotal();
	bytesL = nrMix.getBytesLoaded();
	
	if (preloadNow==true && nrPlaying != true){
		nrLoaded = Math.round((bytesL/bytesT)*100);
		bufferMC._visible = true;
		trace ("BytesLoaded=" + nrLoaded);
		trace("buffering")
	}
	if(preloadNow==true && nrLoaded >= 20){
		bufferMC._visible = false;
		preloadNow = false;
		nrMix.start();
		nrPlaying = true;
		trace("buffering complete");
	}

}

```
