Skip to main content
Participating Frequently
January 18, 2023
Question

Button with hyperlink not working

  • January 18, 2023
  • 1 reply
  • 2809 views

Hello, I'm trying to add a button with an hyperlink to a page on my website to the last frame (the animation is programmed to stop after the last frame) of an HTML5 Canvas animation; when I try the animation in preview the link just works fine, but when I publish it it does not work. What am I missing? Here's the code I added to the action timeline at the last frame:

this.button_1.addEventListener("click", fl_ClickToGoToWebPage);

function fl_ClickToGoToWebPage() {
window.open("https://www.soildao.org/onepager.pdf", "_blank");
}
this.stop();

    This topic has been closed for replies.

    1 reply

    kglad
    Community Expert
    January 18, 2023

    open your browser's developer console and check for errors.

    -ppixAuthor
    Participating Frequently
    January 20, 2023

    Any suggestion?

    kglad
    Community Expert
    January 22, 2023

    What does it mean? Aren't needed images automatically included in the images folder when you publish the animation?


    yes, they are (assuming you're saving on on local hard drive).

     

    what are your publish settings?

    did you manually edit anything in your html or js files?

    do you have an code used to load anything?