# Creating onrollover / onrollout button that plays its full ONanimation when touched

**URL:** <https://forum.kirupa.com/t/creating-onrollover-onrollout-button-that-plays-its-full-onanimation-when-touched/191796>\
**Category:** Uncategorized\
**Created:** [June 23, 2006, 2:32am UTC](https://forum.kirupa.com/t/creating-onrollover-onrollout-button-that-plays-its-full-onanimation-when-touched/191796 "2006-06-23T02:32:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![messlah](https://avatars.discourse-cdn.com/v4/letter/m/c37758/32.png) [@messlah](https://forum.kirupa.com/u/messlah)\
**Post date:** [June 23, 2006, 2:32am UTC](https://forum.kirupa.com/t/creating-onrollover-onrollout-button-that-plays-its-full-onanimation-when-touched/191796/1 "2006-06-23T02:32:13Z")

</div>

Hey all,

On most of my option MC’s I have something like:

this.onRollOver = function(){  
this.gotoAndPlay(“onanim”)  
}  
this.onRollOut = function(){  
this.gotoAndPlay(“offanim”)  
}

Obviousy if you quickly roll on and then off the MC the animation is staggergy and not a fluid animation.

I would like to set it so that everytime you touch/roll on the option MC it will always play its full on animation right, then it will go to the off animation.

I believe you can incorporate onenterframe object to achive this. Could someone please show me a good solution.

Any help would be great.
