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