• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Flvplayback Component Event Listener when enter frame or at Time Code

Participant ,
Jan 18, 2019 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.

Views

231

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
community guidelines

correct answers 1 Correct answer

Community Expert , Jan 18, 2019 Jan 18, 2019

use a cuepoint.

Votes

Translate

Translate
Community Expert ,
Jan 18, 2019 Jan 18, 2019

Copy link to clipboard

Copied

use a cuepoint.

Votes

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
community guidelines
Participant ,
Jan 18, 2019 Jan 18, 2019

Copy link to clipboard

Copied

LATEST

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

}

Votes

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
community guidelines