Skip to main content
JohnnyORevival
Participant
October 11, 2018
解決済み

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

  • October 11, 2018
  • 返信数 1.
  • 1266 ビュー

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....

このトピックへの返信は締め切られました。
解決に役立った回答 JoãoCésar17023019

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

返信数 1

JoãoCésar17023019
Community Expert
Community Expert
October 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

JohnnyORevival
Participant
October 11, 2018

thank you JC! I'll give it a shot