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

How to click anywhere on entire animation/ad and go to web page?

Explorer ,
Oct 11, 2018 Oct 11, 2018

Hi, I just started using Adobe Animate CC, and I was never a fan of Flash many years ago haha, but I am trying get better acquainted with this for HTML5 web ads. I made an animation for a web ad; 300x250, published it, but I need to make it so a user can click anywhere on the ad at any time and it goes to a URL/webpage in a new window. The code snippet has the action "Click to Go to Web Page" but says I need to apply it to an object, I want to be able to apply it to the entire animation. I'm terrible with coding but amazing at copy and pasting....

1.2K
Translate
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

correct answers 1 Correct answer

Community Expert , Oct 11, 2018 Oct 11, 2018

Hi.

You can add the event listener to the window object, to the document, canvas, and even to an invisible display object that overlays the entire stage.

function fl_ClickToGoToWebPage()

{

    window.open("http://www.adobe.com", "_blank");

}

canvas.addEventListener("click", fl_ClickToGoToWebPage);

Regards,

JC

Translate
Community Expert ,
Oct 11, 2018 Oct 11, 2018

Hi.

You can add the event listener to the window object, to the document, canvas, and even to an invisible display object that overlays the entire stage.

function fl_ClickToGoToWebPage()

{

    window.open("http://www.adobe.com", "_blank");

}

canvas.addEventListener("click", fl_ClickToGoToWebPage);

Regards,

JC

Translate
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
Explorer ,
Oct 11, 2018 Oct 11, 2018
LATEST

thank you JC! I'll give it a shot

Translate
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