# Clicking A start animation from begining

**URL:** <https://forum.makecode.com/t/clicking-a-start-animation-from-begining/11670>\
**Category:** Arcade\
**Created:** [January 10, 2022, 6:25pm UTC](https://forum.makecode.com/t/clicking-a-start-animation-from-begining/11670 "2022-01-10T18:25:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![winko](https://avatars.discourse-cdn.com/v4/letter/w/e36b37/32.png) [@winko](https://forum.makecode.com/u/winko)\
**Post date:** [January 10, 2022, 6:25pm UTC](https://forum.makecode.com/t/clicking-a-start-animation-from-begining/11670/1 "2022-01-10T18:25:45Z")

</div>

Hi there,  
here is my testing project [https://makecode.com/\_cpz9tq12z5jE](https://makecode.com/_cpz9tq12z5jE)

I do not know how to stop the process of clicking on the A button when the animation starts. Clicking A button starts animation from the first frame, so the effect is that clicking repeatedly A results in seeing only the first frame.  
I would like to wait till the animation finishes before starting a new one (new sword slash).  
Any thoughts?

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [January 10, 2022, 6:26pm UTC](https://forum.makecode.com/t/clicking-a-start-animation-from-begining/11670/2 "2022-01-10T18:26:57Z")

</div>

Your code is 90% there already! Just add a `pause` block to make it wait for the animation to finish:

 ![Screen Shot 2022-01-10 at 10.26.32 AM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/7/764c5eab37a5e543539fc6db220f4e8a0194cf98.png)

I put in 2000ms for the pause because you have a 4 frame animation with 500ms for each frame.

---

<div class="post-metadata">

**Author:** ![winko](https://avatars.discourse-cdn.com/v4/letter/w/e36b37/32.png) [@winko](https://forum.makecode.com/u/winko)\
**Post date:** [January 10, 2022, 9:15pm UTC](https://forum.makecode.com/t/clicking-a-start-animation-from-begining/11670/3 "2022-01-10T21:15:31Z")

</div>

Hi Richard,

Yes indeed but check that situation, click like 10 times A button, this will result in 20 seconds animation (10 slashes). Like, arcade is putting call A actions on stack / list and runs it till the end.  
I am looking for option to stop “putting” those A calls on stack, e.g.: I was clicking A button 5 times in 3 seconds, so only two slashes occured.

---

<div class="post-metadata">

**Author:** ![Sarge](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sarge/32/19590_2.png) [@Sarge](https://forum.makecode.com/u/Sarge)\
**Post date:** [January 11, 2022, 4:56pm UTC](https://forum.makecode.com/t/clicking-a-start-animation-from-begining/11670/4 "2022-01-11T16:56:49Z")

</div>

The best solution is to use the timer extention, use the wait block and put the code you want to execute in there. That will prevent stacking

---

<div class="post-metadata">

**Author:** ![winko](https://avatars.discourse-cdn.com/v4/letter/w/e36b37/32.png) [@winko](https://forum.makecode.com/u/winko)\
**Post date:** [January 11, 2022, 5:28pm UTC](https://forum.makecode.com/t/clicking-a-start-animation-from-begining/11670/5 "2022-01-11T17:28:52Z")

</div>

Works as expected, thanks @Sarge

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/1/1a77a71cce51bb2cd1656c5e1d0d9bd9a2645947.png)

---

<div class="post-metadata">

**Author:** ![Sarge](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sarge/32/19590_2.png) [@Sarge](https://forum.makecode.com/u/Sarge)\
**Post date:** [January 11, 2022, 6:47pm UTC](https://forum.makecode.com/t/clicking-a-start-animation-from-begining/11670/6 "2022-01-11T18:47:19Z")

</div>

No problem, glad to help
