Problems using Event CuePoints w/FLVPlayback - time delay issues

I’m doing a large scale project that relies on a number of FLVs playing in an FLVPlayback.

The rubric is that the FLV will play until it reaches a particular cue point which will signal a custom-named event that I’ve added with the Adobe FLV encoder. I view the MOV from which the FLV is derived in QuickTime, note down the frame number I wish to stop at and then get as close as I can in the FLV encoder to the time I calculate (frame number/fps of the SWF). The FPS of the SWF and the MOV are the same (30 FPS). (As an aside, what are the jumps in the FLV encoder’s playhead time – it doesn’t seem to correspond timewise to the actual frames in the MOV, i.e. not one for one?).

I set up a handler function in my document class to handle the cue point being reached:

        flvPlay.addEventListener(MetadataEvent.CUE_POINT,handleCuePoint,false,0,true);

which I handle by stopping the FLV and putting up my own material overlaid


            if ($event.info.name.indexOf("open") != -1) {
                    halt();

.....

    // stops the video playing and sets the flag
    private function halt():void {
        flvPlay.stop();
        _amPlaying = false;
    }

Then on user interaction I set the FLV playing again.

This has all worked fine locally. But I’m getting some weird and inconsistent results online. The video does not stop at the same point all the time – and sometimes I don’t seem to be receiving the OPEN event at all.

Could this be due to lags due to streaming – the back and forth over the internet? If so, what’s the best way to handle this? I could set a navigation cue point where I want to be, and seek() back to that – but that could be jumpy.

I attach a jpg to help clarify what I’ve done above – the purple lines show how things should be (although in actuality the flow should stop immediately, not one frame ahead); the red lines show what does happen – that the FLV doesn’t stop until much later than it should.

I’m sure this has been done many times – what’s the correct way to implement?

Thanks!