Skip to main content
Participant
January 24, 2019
Answered

clickTAG working in test, not working on publish.

  • January 24, 2019
  • 2 replies
  • 1248 views

I have made a banner ad in HTML 5 with a clickTAG on a button. When I run a test inside of Animate, the button works fine. When I publish the button doesn't work. I am very new to Animate and have spent half the day combing forums and YouTube to no avail.

Here is the clickTAG code

this.clickTAG.addEventListener("click", fl_ClickToGoToWebPage_4);
function fl_ClickToGoToWebPage_4() {
window.open("https://bottomlounge.com/events", "_blank");
This topic has been closed for replies.
Correct answer kdmemory

Hi ehren

How do you test after publishing? Do you just open your export HTML document from your local disk or do you test from a server?

When you test inside Animate (ctrl/cmd + Enter), a local web server is invoked automatically (http://127.0.0.1​) and Javascript calls work without glitch. If you open the document after publishing witout this server support this can cause problems. Make sure you test your stuff always on a web server.

There are also opportunities to install a local web server for test runs like this. Look into MAMP or WAMPserver.

Your function fl_ClickToGoToWebPage_4 needs by the way a closure } in line 06, though that's propably just a copy/paste miss.

Klaus

2 replies

kdmemory
kdmemoryCorrect answer
Inspiring
January 24, 2019

Hi ehren

How do you test after publishing? Do you just open your export HTML document from your local disk or do you test from a server?

When you test inside Animate (ctrl/cmd + Enter), a local web server is invoked automatically (http://127.0.0.1​) and Javascript calls work without glitch. If you open the document after publishing witout this server support this can cause problems. Make sure you test your stuff always on a web server.

There are also opportunities to install a local web server for test runs like this. Look into MAMP or WAMPserver.

Your function fl_ClickToGoToWebPage_4 needs by the way a closure } in line 06, though that's propably just a copy/paste miss.

Klaus

Participant
January 24, 2019

I am just opening the HTML file in Chrome so perhaps that IS the issue.

Inspiring
January 24, 2019

Hi,

you are missing a } on line 6.

When you say Publish do you mean hitting CTRL and Enter on Windows (or Control > Test) in Animate to test it? Or you mean testing it on a server?

To help you for future reference then when you say you Published anything regarding to Animate then that is meaning you tested it in Animate locally on your computer i.e. hitting CTRL and Enter on Windows (or Control > Test) in Animate.

When I add the } to line 6 and test it then it works for me.

Hope this helps?

Participant
January 24, 2019

Hi!

When I control test it works. When I open up the html file in Chrome, it does not. I checked the code in Dreamwaver just now and the } does appear after the url line code.

Inspiring
January 24, 2019

Hi,

try it on a few different browsers besides Chrome. If it works on some and not on others then this is the browser's security kicking in.

It should work if you try and run it off a server and not locally.