# Actionscript for a MovieClip used as a button

**URL:** <https://forum.kirupa.com/t/actionscript-for-a-movieclip-used-as-a-button/147612>\
**Category:** Uncategorized\
**Created:** [May 12, 2005, 4:41am UTC](https://forum.kirupa.com/t/actionscript-for-a-movieclip-used-as-a-button/147612 "2005-05-12T04:41:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![PaintedSwan](https://avatars.discourse-cdn.com/v4/letter/p/90db22/32.png) [@PaintedSwan](https://forum.kirupa.com/u/PaintedSwan)\
**Post date:** [May 12, 2005, 4:41am UTC](https://forum.kirupa.com/t/actionscript-for-a-movieclip-used-as-a-button/147612/1 "2005-05-12T04:41:49Z")

</div>

My problem is pretty simple, but I’m still finding my way around even the simplest things in Actionscript. I have a movieclip named ‘leaf9’ in which I’m using as a button (which happens to be within another movieclip). I have the following actionscript on the frame which contains ‘leaf9’:

[AS]  
leaf9.onRollOver = function(){  
this.gotoAndPlay(“rollover”);  
}  
leaf9.onRollOut = function(){  
this.gotoAndPlay(“rollout”);  
}  
leaf9.onPress = function(){  
this.gotoAndPlay(“pressdown”);  
}  
leaf9.onRelease = function(){  
this.gotoAndPlay(“shrink”);  
}  
[/AS]

What I want is for all the other functions to go away once “shrink” has started to play, so that if the mouse goes over the button again, the clip doesn’t start playing “rollover” etc etc. So how do I stop all the other functions from playing once the .onRelease function has started? Any help would be appreciated =)
