# Flv buffer animation

**URL:** <https://forum.kirupa.com/t/flv-buffer-animation/245396>\
**Category:** Uncategorized\
**Created:** [November 29, 2007, 10:46am UTC](https://forum.kirupa.com/t/flv-buffer-animation/245396 "2007-11-29T10:46:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sparkdemon](https://avatars.discourse-cdn.com/v4/letter/s/958977/32.png) [@sparkdemon](https://forum.kirupa.com/u/sparkdemon)\
**Post date:** [November 29, 2007, 10:46am UTC](https://forum.kirupa.com/t/flv-buffer-animation/245396/1 "2007-11-29T10:46:07Z")

</div>

respected programmers,

i am trying to make a flv http progressive download mechanism.  
the mechanism involves a preloader to show when the buffer is refilling.

My code is like this:

if(infoObject.code.toString()==‘NetStream.Buffer.E mpty’)  
{  
my\_video.\_alpha=30;  
var ldr:MovieClip=\_root.attachMovie(“loader”,“loader”, 0);  
ldr.\_x=Stage.width/2;  
ldr.\_y=Stage.height/2;  
}  
if(infoObject.code.toString()==‘NetStream.Buffer.F ull’)  
{  
my\_video.\_alpha=100;  
\_root.loader.removeMovieClip();  
}  
if(infoObject.code.toString()==‘NetStream.Buffer.F lush’)  
{  
//stream\_ns.seek(0);  
stream\_ns.play(vidName);  
}

* * *

However i notice that , each time the buffer fills up, the stream starts playing before the loader is removed from screen. I want to to know, why this lag is there.

also how can i solve this problem , so that each time the buffer is full again, the loader should be removed first and then the stream should play.
