Skip to main content
hanskfroschauer
Known Participant
March 27, 2017
Answered

Buttons need multiple clicks before they work?

  • March 27, 2017
  • 2 replies
  • 468 views

Hi, I made this example test

I use standard code snippets from within Animate CC. The green button restarts the animation, the red button stops it. However, upon loading the animation, I have to click a button 2 times before it does what it's supposed to: Reload the animation, click the red button once (nothing happens), click it again (nothin happens), click it a third time, and it does what it's supposed to. Same goes for the green button. What's causing this?

Heres the code snippets I use (as I said, they're standard, from the 'Code Snippets' panel):

Green button:

this.button_1.addEventListener("click", fl_ClickToGoToAndPlayFromFrame.bind(this));

function fl_ClickToGoToAndPlayFromFrame()

{

  this.gotoAndPlay(1);

}

Red button:

this.button_2.addEventListener("click", fl_ClickToGoToAndStopAtFrame.bind(this));

function fl_ClickToGoToAndStopAtFrame()

{

  this.gotoAndStop(1);

}

    This topic has been closed for replies.
    Correct answer Colin Holgate

    The test works all the time on my Mac, but on iPad Pro it sometimes misses. I think that's because you have the HTML set up to allow highlighting and scrolling of the page. If those were disabled I would expect iPad to work the same.

    2 replies

    Colin Holgate
    Colin HolgateCorrect answer
    Inspiring
    March 27, 2017

    The test works all the time on my Mac, but on iPad Pro it sometimes misses. I think that's because you have the HTML set up to allow highlighting and scrolling of the page. If those were disabled I would expect iPad to work the same.

    kglad
    Community Expert
    Community Expert
    March 27, 2017

    the 2nd frame has to load before you can goto it.