# Help with cue points AS3

**URL:** <https://forum.kirupa.com/t/help-with-cue-points-as3/328626>\
**Category:** flash\
**Created:** [May 31, 2012, 4:01pm UTC](https://forum.kirupa.com/t/help-with-cue-points-as3/328626 "2012-05-31T16:01:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Losttruths](https://avatars.discourse-cdn.com/v4/letter/l/977dab/32.png) [@Losttruths](https://forum.kirupa.com/u/Losttruths)\
**Post date:** [May 31, 2012, 4:01pm UTC](https://forum.kirupa.com/t/help-with-cue-points-as3/328626/1 "2012-05-31T16:01:46Z")

</div>

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!
