Preloading of a .flv

Hi there,

I’m trying to make a custom preloader for a .flv. But it won’t work for me!

This is the code:

var flvControl:FLVPlayback = display;
var flvSource:String = "video.flv";
 
display.addEventListener(ProgressEvent.PROGRESS, onLoadProgress);
function onLoadProgress(event:ProgressEvent):void{
    var loadedPct:uint = Math.round(100 * (event.bytesLoaded / event.bytesTotal));
    loading_text.text = loadedPct.toString();
    trace(event.bytesLoaded);
    if (loadedPct == 100){
        //do something
    }
}
 
flvControl.source = flvSource;

What am I doing wrong?