# Stop the button code until animation ends

**URL:** <https://forum.kirupa.com/t/stop-the-button-code-until-animation-ends/253073>\
**Category:** flash\
**Created:** [February 26, 2008, 10:53pm UTC](https://forum.kirupa.com/t/stop-the-button-code-until-animation-ends/253073 "2008-02-26T22:53:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![garmani](https://avatars.discourse-cdn.com/v4/letter/g/34f0e0/32.png) [@garmani](https://forum.kirupa.com/u/garmani)\
**Post date:** [February 26, 2008, 10:53pm UTC](https://forum.kirupa.com/t/stop-the-button-code-until-animation-ends/253073/1 "2008-02-26T22:53:31Z")

</div>

[COLOR=black][FONT=Verdana]Hi Guys,

very new here, don’t know whether someone had similar problem. I need help in fixing this ■■■■ thing. I think it is a small fix. Well here is the scenario.

I have Previous and Next Buttons. I have the required code that makes them work perfectly. And on each button click i am doing some animation using the Tween effect in Action Script 3. My code on Next is this

**var PMTween1:Tween = new Tween(P\_M, “x”, Regular.easeOut, P\_MN1, P\_M.x, 1, true);**

Since the animation spans for 1 sec I don’t want any code to be executed until it stops. That means during this animation if the user clicks Previous i don’t want that code to get execute until the Next codes animation stops. Hope I made it clear.

Please help.[/FONT][/COLOR]
