Copy link to clipboard
Copied
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.
if you want something to execute once and not on subsequent loops, use:
if(!this.alreadyExecuted){
this.alreadyExecuted=true;
//window.open(for example)
}
Copy link to clipboard
Copied
if you want something to execute once and not on subsequent loops, use:
if(!this.alreadyExecuted){
this.alreadyExecuted=true;
//window.open(for example)
}
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
it solves your original problem by preventing your click listener from executing repeatedly.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now