Skip to main content
Participating Frequently
July 30, 2025
Question

Click Tag Button - External URL link not working

  • July 30, 2025
  • 4 replies
  • 1181 views

Hi All,

I'm new to Animate, but I built my HTML5 ad which I want to add to the Google Display Network.

The ad works just as I want it, however, I can't get the ClickTag to work.

I've made the Click Tag the top layer, made a rectangle the full size of the ad and convereted it to a symbol, cut it from frame 1 and added it to the hit frame.

On Frame 1 in the Click Tag layer I have added the following script to the 1st frame:

 

clickBtn.addEventListener("click", function() {
window.open(window.clickTag, "https://aistudio.je/work/");
});

 

I have a script layer at the bottom of the layers with the following script:

var _this = this;

// Stops timeline on X loop or return to start
if (!this.looped) this.looped = 1;
if (this.looped++ == 3) this.stop();
else _this.gotoAndPlay('start');

 

The ad works as I want it but I cannot get this to work when you click on the ad to take you to the URL destination specified.

 

    4 replies

    JoãoCésar17023019
    Community Expert
    Community Expert
    July 31, 2025

    Hi.

     

    Have you tried the instructions from this video that starts at around 15:20?
    https://www.youtube.com/watch?v=455eHaBtPDY

    I don't create banners, so I'm not aware of the exact requirements.

     

    Regards,

    JC

    Participating Frequently
    July 31, 2025

    Thanks I'll take a look. I think best thing I can do is build the animation from scratch and hope it works.

     

    Mario_CR
    Community Expert
    Community Expert
    July 31, 2025

    Remember to assign your Button an instance name or you're going to get these errors

     

    The name of the symbol and the name of the instance are different things.

    Most likely you typed the Symbol's name instead of the instance name.

     

    Simply add an instance name and make sure it matches on your code:

     

    I made a quick fla sample file with a working clicktag link, hope it helps: https://limewire.com/d/xkySf#voCf3I2SgR

     

    Participating Frequently
    July 31, 2025

    Thank you for your replies. I've tried both, but I still can't get this to work.

    I've attached some screen grabs which may help. Like I say the ad animates and works on the preview, when you hover over the image it looks clickable (the mouse changes) but when you click on it, it does nothing.

    kglad
    Community Expert
    Community Expert
    July 31, 2025

    do you have an object named your_btn on the frame where your this.your_btn code appeas?

     

    if so, what's your developer console show?  and if you don't know how to debug html5 projects, read:

     

     

     

    Lesson 1: https://youtu.be/bG05_am-fQI

    Lesson 2: https://youtu.be/H9e9toftvdM

    kglad
    Community Expert
    Community Expert
    July 31, 2025

    in general,

     

    In the Actions window - on the "Global>Script" pane you want to define the clickTag variable by putting this code:
    var clickTag = "https://www.example.com"; // Destination URL​

     

    Then for your_btn 

     

    this.your_btn.addEventListener("click", function() {
    window.open(window.clickTag, "_blank");
    });

    Mario_CR
    Community Expert
    Community Expert
    July 30, 2025

    In the actions panel, you need to declare the clickTag variable in Global > Script like so:

    var clickTag = "https://aistudio.je/work/"; // Destination URL​