Hello everybody … I’m trying to set up a preview for my FLVplayback component in as2, it’s progressive download and It’s making me crazy.
Once it’s loaded into the cache it works perfect but before that it doesn’t work at all, here’s my code:
doOnce=0;
var listenerObject:Object = new Object();
listenerObject.stateChange = function(eventObject:Object):Void {
trace(flvPlayer.state);
if (eventObject.state == "playing") {
if (_root.doOnce == 0) {
trace("Preview--");
flvPlayer.pause();
flvPlayer.playheadTime = 1;
_root.doOnce++;
trace("--Preview");
}
};
flvPlayer.addEventListener("stateChange",listenerObject);
Basically it listens for the playing event, skips ahead to display some frame, and pauses is there a way to preload this video, or a way to make sure that the video is loaded enough before skipping ahead to that frame?
any help is greatly appreciated.