Skip to main content
LBoland
Participant
September 29, 2020
Question

Help with on click go to website

  • September 29, 2020
  • 2 replies
  • 251 views

Hi,

 

I'm trying to create a HTML5 web banner ad. I need to have a transparent button on the top layer with an action set to load the target URL. However, when I test or publish, the button doesn't work. It doesn't even appear to be there when I hover over the stage.

 

This is the code I am using:


var _this = this;
/*
Clicking on the specified symbol instance executes a function.
*/
_this.CTA.on('click', function(){
/*
Loads the URL in a new browser window.
*/
window.open('http://www.adobe.com', '_blank');
});

 

This topic has been closed for replies.

2 replies

JoãoCésar17023019
Community Expert
Community Expert
September 29, 2020

Hi.

 

To effectively create an invisible button:

- Draw a shape;

- Convert it to a Button symbol;

- Move the shape to the Hit frame;

- Make sure the other frames are empty.

 

 

I hope it helps.

 

Regards,

JC

LBoland
LBolandAuthor
Participant
September 29, 2020

After a bit of research, it appears as though it is being affected by having no fill on the button shape. I have had to add a 1% transparency to get the button to work. Does anyone know of a tidier way of doing this?