Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Problems producing HTML5 document to record mouse clicks online

New Here ,
Jul 03, 2018 Jul 03, 2018

Not sure if this is a topic already covered.

I have recently produced a looping web banner in HTML5 canvas. I had to add the click Tag in the HTML (which I foolishly thought animate cc would automatically do when publishing the html and the javascript document).

So everything was okay except that in some web browsers after every full loop when clicked the url action opens up a tab - so if it loops 4 times before it's clicked it opens up 4 tabs etc etc.

I got around this by renaming the url window opening from 'blank' to another name like 'myTab'.

So far so good - uploaded the files to an  HTML5 validator file and everything was checked okay.

However the online publisher said that it was not recording the clicks - do I have to add yet more code to the HTML to achieve this or add code in the timeline regards the button action?

Any help would be gratefully accepted -  in the past I have been used to producing and exporting files as swf files and movies using action script, I know animate cc is still Flash to a certain extent but I have never had this problem with mouse clicks on line not being recorded.

230
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jul 03, 2018 Jul 03, 2018

if you want something to execute once and not on subsequent loops, use:

if(!this.alreadyExecuted){

this.alreadyExecuted=true;

//window.open(for example)

}

Translate
Community Expert ,
Jul 03, 2018 Jul 03, 2018

if you want something to execute once and not on subsequent loops, use:

if(!this.alreadyExecuted){

this.alreadyExecuted=true;

//window.open(for example)

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 03, 2018 Jul 03, 2018

Thanks for the tip on that bit of code which I shall incorporate - but would this solve the problem with recording the clicks for the web stats when live on the publishers website?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 03, 2018 Jul 03, 2018
LATEST

it solves your original problem by preventing your click listener from executing repeatedly.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines