Copy link to clipboard
Copied
I'm playing video using the Flvplayback component and AS3 to drive. I'm wanting to use an eventListener that triggers when a specific frame or TC is reached in the flvplayback MC video. OR if there's a another way to trigger the action without an eventListener that's great too?
I tried the following script:
stage.addEventListener(Event.ENTER_FRAME, everyFrame);
function everyFrame(event:Event):void
{
if (vidLoop.currentFrame == 125) {
// this jumps to 18 seconds in the flvplayback video MC - testing and works with both mouseclick and keyboard events
var sec:Number = 18; flvControl.seek(sec);
}
}
Note: flvplayback component is otherwise working fine - video plays and is controllable with AS3 in other respects.
Thanks in advance for any time/consideration to this issue you can lend.
use a cuepoint.
Copy link to clipboard
Copied
use a cuepoint.
Copy link to clipboard
Copied
Thanks KGLAD. Yeah, I was being stubborn and trying to do this without a cuepoint... I got this working using your suggestion tho...
For anyone else following this string:
//adds cuepoint at 163 seconds labeled 'loopPoint'
flvControl.addASCuePoint(163, "loopPoint")
//uses cuepoint listener to trigger video to jump in timeline
vidLoop.addEventListener(MetadataEvent.CUE_POINT, fl_CuePointHandler_1);
function fl_CuePointHandler_1(event:MetadataEvent):void
{
var sec:Number = 18; flvControl.seek(sec);
}