Skip to main content
Participant
February 14, 2018
Question

BANNER

  • February 14, 2018
  • 2 replies
  • 257 views

Hello, I made a banner but when I click many pages are opened, one for each time the banner starts! why? why?

This topic has been closed for replies.

2 replies

Colin Holgate
Inspiring
February 14, 2018

It's quite likely that you're adding the click listener again every times the animation starts. Either loop the animation back to the frame after your listener is added, or first check to see if the listener exists:

if(!this.mybutton.hadEventListener("click",clicked)) this.mybutton.addEventListener("click",clicked);

Or something like that.

kglad
Community Expert
Community Expert
February 14, 2018

show your relevant code.