Preloader in a video player class


I want to add this function to my videoplayer class :

private function onProgress(e:ProgressEvent):void{
   var percent:Number = e.bytesLoaded / e.bytesTotal;
   fill_mc.scaleX = percent;
   text_txt.text = "Loading..."+(Math.round(percent*100))+"%";

private function onComplete(e:Event):void{, 3, {alpha:0});

In order to have a preloader in case the video takes time to dl.

How do I rely it to the the netsream, what do I have to add , and where exactly?

Thanks for your help