Skip to main content
gintarasš35427327
Participant
June 17, 2020
Answered

Animate CC. html5 random popup

  • June 17, 2020
  • 1 reply
  • 456 views

Hi, Im creating html5 banners with Animate CC. For this case my created banner has few buttons with links to land.

The problem is when you press button after the first rotation (like on 2nd or 3rd loop) it opens link and 2, 3 or more popups (automatically blocked by browser) depends on how many loops you watched. Have no idea why it stacks these popups instead of openning just 1 single web link at any time?...

    This topic has been closed for replies.
    Correct answer kglad

    execute your listener once only.  don't repeat that code when your timeline replays:

     

    this.prevent_replay;

     

    if(!this.prevent_replay){

    this.prevent_replay=true;

    yournonrepeatinglistenerobjects.addEventListener(etc...)

    }

    1 reply

    kglad
    Community Expert
    kgladCommunity ExpertCorrect answer
    Community Expert
    June 17, 2020

    execute your listener once only.  don't repeat that code when your timeline replays:

     

    this.prevent_replay;

     

    if(!this.prevent_replay){

    this.prevent_replay=true;

    yournonrepeatinglistenerobjects.addEventListener(etc...)

    }

    gintarasš35427327
    Participant
    June 18, 2020

    First thank you for responding. And second big thanks for your shared knowledge, was really stuck over here.

    kglad
    Community Expert
    Community Expert
    June 18, 2020

    you're welcome.