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.
Copy link to clipboard
Copied
$("#movie01")
show be
$("#movie01")[0]
Copy link to clipboard
Copied
Is the [0] instead of .on in the line
this.movie01.on("added", function() {
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);
}
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.
Copy link to clipboard
Copied
Here is fla file.
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.
Copy link to clipboard
Copied
I don't see the FLA, but in the web page there are errors showing, at test2.js lines 148 and 156.