# \[AS2\]disable button till animation is finished

**URL:** <https://forum.kirupa.com/t/as2-disable-button-till-animation-is-finished/226205>\
**Category:** Uncategorized\
**Created:** [May 18, 2007, 8:43pm UTC](https://forum.kirupa.com/t/as2-disable-button-till-animation-is-finished/226205 "2007-05-18T20:43:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ohls](https://avatars.discourse-cdn.com/v4/letter/o/59ef9b/32.png) [@Ohls](https://forum.kirupa.com/u/Ohls)\
**Post date:** [May 18, 2007, 8:43pm UTC](https://forum.kirupa.com/t/as2-disable-button-till-animation-is-finished/226205/1 "2007-05-18T20:43:27Z")

</div>

I’m trying to make a script that will disable leftarrow till the animation is finished. I made a crude attempt myself but it doesn’t work :/.

Any ideas?

[AS]import mx.transitions.Tween;  
allowChanging = true;  
if (allowChanging == true) {  
this.leftarrow.onRelease = function() {  
var myTween:Tween = new mx.transitions.Tween(\_root.images.imagemove, “\_x”, mx.transitions.easing.Regular.easeOut, \_root.images.imagemove.\_x, \_root.images.imagemove.\_x+700, 10);  
allowChanging = false;  
myTween.onMotionFinished = function() {  
allowChanging = true;  
};  
};  
}  
[/AS]

thanks!
