Highlighted

Flvplayback Component Event Listener when enter frame or at Time Code

Participant ,
Jan 18, 2019

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.

Adobe Community Professional
Correct answer by kglad | Adobe Community Professional

use a cuepoint.

TOPICS
Discussions

Views

120

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Flvplayback Component Event Listener when enter frame or at Time Code

Participant ,
Jan 18, 2019

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.

Adobe Community Professional
Correct answer by kglad | Adobe Community Professional

use a cuepoint.

TOPICS
Discussions

Views

121

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jan 18, 2019 0
Adobe Community Professional ,
Jan 18, 2019

Copy link to clipboard

Copied

use a cuepoint.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 18, 2019 0
Participant ,
Jan 18, 2019

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);

}

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 18, 2019 0