Copy link to clipboard
Copied
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....
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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
thank you JC! I'll give it a shot
Find more inspiration, events, and resources on the new Adobe Community
Explore Now