Skip to main content
Participant
November 28, 2018
Answered

How to play video forwards and backwards using external push buttons?

  • November 28, 2018
  • 1 reply
  • 367 views

Hello,

I am new to Adobe Animate, and tried to watch a bunch of tutorials and read instructions but simply couldn't get to what I want to do.

I would like to set up an interactive where there is a video people can control. Connected to the computer there will be two push buttons that users can interact with.

I would like one of the buttons to play the video forwards, and the other to play the video backwards. I haven't had success in how to set up this code, and keep getting error messages.

The error messages are usually something like "Scene 1, Layer 'Actions', Frame 1, Line 16, Column 2 1120: Access of undefined property Plate."
(I named my video "Plate" in the Library)

Here's the simple code I started with -

_________________________________

/* Click To Play Video (Requires FLVPlayback component)

Clicking on the symbol instance plays a video in the  specified FLVPlayback component instance.

Instructions:

1. Replace video_instance_name below with the instance name of the FLVPlayback component that you want to play the video.

   The specified instance of FLVPlayback video component on stage will play.

2. Make sure you have assigned a video source file in the properties of the FLVPlayback component instance.

*/

movieClip_1.addEventListener(MouseEvent.CLICK, fl_ClickToPlayVideo_2);

function fl_ClickToPlayVideo_2(event:MouseEvent):void

{

// Replace video_instance_name with the instance name of the video component

Plate.play();

}

_____________________________

Any direction, or even specific code could help.

Thanks,

Rachel

This topic has been closed for replies.
Correct answer kglad

use a skin with rewind and test if that's what you want.  it seems unlikely it is.

1 reply

kglad
Community Expert
Community Expert
November 29, 2018

by play the video backwards, unless you mean 'rewind' the video, you can't do that with an flvplayback component.

you would need to add your video to a timeline and then write code to enable that timeline to play backwards.

Participant
November 29, 2018

Rewind could work if it is smooth enough, or if there is an option to go backwards and forwards one frame, holding down the button could make this work to play it.

I'm not quite understanding your second point. If I were to write code to play the video backwards on a timeline would this achieve my goal?

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
November 29, 2018

use a skin with rewind and test if that's what you want.  it seems unlikely it is.