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

PLEASE! getting back to menu when video is done

Participant ,
Dec 29, 2021 Dec 29, 2021

Copy link to clipboard

Copied

I have used this code in the past to return to main menu of a simple HTML5 canvas video player interactive before but now it won't work. (actions layer code on video player frame)

this.stop();

var root = this;

this.movie01.on("added", function() {

$("#movie01").on("ended", function() {

movetoMenu();

});

});

function movetoMenu() {
console.log("go back to menu");
root.gotoAndStop(0);
}

 

What am I missing or doing wrong, PLEASE? Should be so simple.

Views

162

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
Community Expert ,
Dec 30, 2021 Dec 30, 2021

Copy link to clipboard

Copied

$("#movie01")

 

show be

 

$("#movie01")[0]

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 ,
Dec 30, 2021 Dec 30, 2021

Copy link to clipboard

Copied

Is the [0] instead of .on in the line

 

this.movie01.on("added", function() {

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
Community Expert ,
Dec 30, 2021 Dec 30, 2021

Copy link to clipboard

Copied

no, it's the jquery name:

 

this.stop();

var root = this;

this.movie01.on("added", function() {

$("#movie01")[0].on("ended", function() {

movetoMenu();

});

});

function movetoMenu() {
console.log("go back to menu");
root.gotoAndStop(0);
}

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 ,
Dec 31, 2021 Dec 31, 2021

Copy link to clipboard

Copied

Here is a simple test where the selected video just stops and animation does not return to menu:

 

https://rickgodin.net/marla/test2.html 

 

I tried with and without the [0] added to the function line mentioned above.

 

I've attached fla file for your review. thanks, rg

 

Please help.

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 ,
Dec 31, 2021 Dec 31, 2021

Copy link to clipboard

Copied

Here is fla file.

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
Community Expert ,
Dec 31, 2021 Dec 31, 2021

Copy link to clipboard

Copied

i generally don't download and correct files unless i'm hired.  free help i offer via the adobe forums.

 

that said, there's nothing wrong with my code (assuming you set everything up correctly), so i suggest you open the developer console and see if there's an error somewhere. 

 

if there is no error, try using an older (than 2021 v.21 animate).  i'm seeing a video/code problem in animate 2022 v.22 and in animate 2021 v.21, but not in animate 2019 v.19.  2020 v.20 is available via adobe support and the bug may (or may not) exist in that version.

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
LEGEND ,
Dec 31, 2021 Dec 31, 2021

Copy link to clipboard

Copied

LATEST

I don't see the FLA, but in the web page there are errors showing, at test2.js lines 148 and 156.

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