I’ve been having a strange problem with cue points, i’m using them to skip forward and backward in a FLV.
Im using the following to report the current cue point.
vplayer.addEventListener(MetadataEvent.CUE_POINT, cp_listener);
function cp_listener(eventObject:MetadataEvent) {
trace("Cue point name is: " + eventObject.info.name);
trace("Cue point time is: " + eventObject.info.time);
currentcue = eventObject.info.name;
videoplace_txt.text = currentcue;
if (currentcue != ‘1’)
{
vplayer.stop();
}
which works fine. I’m assigning the cue points via AS.
eg
vplayer.addASCuePoint(9, “2”);
vplayer.addASCuePoint(16, “3”);
vplayer.addASCuePoint(22, “4”);
and using the following to skip forward, backwards is the same but myNumber - 1 instead.
nextchapter_btn.addEventListener(MouseEvent.CLICK, nextchapter );
function nextchapter (event1)
{
var myNumber1 = Number(currentcue);
myNumber1++;
currentcue= String(myNumber1);
trace(currentcue);
vplayer.seek(vplayer.findCuePoint(currentcue, CuePointType.ACTIONSCRIPT)[“time”]);
videoplace_txt.text = currentcue;
}
If I just play the clip the cue points fire at the times I set them to. But when I skip back and forth they seem to loose timing. Always the same amounts. if I skip back or forward to cue point ‘3’ it takes the clip to 21 seconds rather than 16. I have been ragging my brains to try and fix it but with no such luck. My knowledge of as3 isn’t great I’ve been learning as I go, so I apologies in advance if my coding is messy.
hope you can help!