Thursday, October 20, 2005

FLVPlayer and Cuepoints

Yet another one of my flash project. This time involving sync'ing flv and frames. Since the flv will be loaded from CDROM, there might be a delay between loading time and actually playing time. Also user could pause, so we need to use cuepoints to sync.

The following generic code does what i want:

my_FLVPlybk.contentPath = "http://www.helpexamples.com/flash/video/water.flv";
// add 2nd AS cue point using time and name parameters
my_FLVPlybk.addASCuePoint(1, "elapsed_time2");
var listenerObject:Object = new Object();
listenerObject.cuePoint = function(eventObject:Object):Void { trace("here");}
my_FLVPlybk.addEventListener("cuePoint", listenerObject);

Funny thing is you HAVE to define contentPath BEFORE the cuepoints ....

Sux..

0 Comments:

Post a Comment

<< Home