FLVPlayback FLV Preloader
Here’s a way to Preload flv files before you play them in FLVPlayback component.
import mx.video.*;
var listenerObject:Object = new Object();
my_FLVPlybk.progressInterval = 001;
my_FLVPlybk.autoPlay = false;
listenerObject.progress = function(eventObject:Object) :Void {
var perc = Math.floor(eventObject.bytesLoaded * 100 / eventObject.bytesTotal);
this.loading_mc.load_txt.text = perc + "% loaded.";
if(perc == 100)
my_FLVPlybk.play();
}
my_FLVPlybk.addEventListener("progress", listenerObject);
my_FLVPlybk.load("yourflv.flv");
You can hide the player while its getting downloaded and show it when its fully downloaded. Make sure to set the autoplay option to false.
Happy coding ![]()
May 27th, 2008 at 7:47 pm
Would that work with action script 3 flash cs3…if it supposed to, this is the error I’m getting when I use the code.
1046: Type was not found or was not a compile-time constant: Void.
May 28th, 2008 at 5:48 am
Not sure regarding AS3. The code provided above is for AS2. Probably you can remove the Void return type for AS3.
June 25th, 2008 at 3:55 pm
Thank’s a lot. I applied your code successfully to my project ! I tried before on my own to figure out somethink like your code .. but i fuc.. up