Highlighted

How do I make HTML5 play next frame after video component end?

Community Beginner ,
Sep 29, 2019

Copy link to clipboard

Copied

I place start button in the frame 0 and video component in the frame 1(only autoplay check) and 2(loop), if I assign "click to go to frame 1 and play" HTML5 will skip video 1 because it is only 1 frame duration if I assign "click to go to frame 1 and stop" it will end at video 1 last frame and not play video 2 at frame 4.
I want to make HTML5 play nextframe after video at frame 1 END.

Thank you for reading.

 

Views

203

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

How do I make HTML5 play next frame after video component end?

Community Beginner ,
Sep 29, 2019

Copy link to clipboard

Copied

I place start button in the frame 0 and video component in the frame 1(only autoplay check) and 2(loop), if I assign "click to go to frame 1 and play" HTML5 will skip video 1 because it is only 1 frame duration if I assign "click to go to frame 1 and stop" it will end at video 1 last frame and not play video 2 at frame 4.
I want to make HTML5 play nextframe after video at frame 1 END.

Thank you for reading.

 

Views

204

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
Sep 29, 2019 0
Adobe Community Professional ,
Sep 30, 2019

Copy link to clipboard

Copied

this.stop();
var thisTimeline = this;

// video must not be set to autoplay
// video must not be set to loop

// wait until video component is fully initialized
stage.on("drawstart", initVideo, this, true);

// add event listener to video and tell it to play
function initVideo() {
	$("#myMovieClip")[0].addEventListener("ended", nextFrame);
	$("#myMovieClip")[0].play();
}

// remove event listener and continue
function nextFrame(evt) {
	evt.currentTarget.removeEventListener("ended", nextFrame);
	thisTimeline.gotoAndStop(thisTimeline.currentFrame + 1);
}

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...
Sep 30, 2019 1
Community Beginner ,
Oct 02, 2019

Copy link to clipboard

Copied

it work perfectly! Thank you for your help.

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...
Oct 02, 2019 0